Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack trace error messages less useful on latest releases of Chrome #242

Closed
anodos opened this issue Oct 21, 2014 · 2 comments
Closed

Stack trace error messages less useful on latest releases of Chrome #242

anodos opened this issue Oct 21, 2014 · 2 comments

Comments

@anodos
Copy link
Contributor

anodos commented Oct 21, 2014

I recently updated to Chrome 38.0.2125.104 and Streamline stack traces have become less useful. Here is an example:

TypeError: Cannot read property 'Symbol(formatted stack trace)' of undefined
    at TypeError.stack (http://localhost:8080/js/bootstrap.js:20222:7294)
    at http://localhost:8080/js/compiled-templates/_core_event_1fcdcaa5abb9a00df84963a0c4348c5c.js:398:296
    at ___ (http://localhost:8080/js/bootstrap.js:20222:4157)

Specifically, before this version of Chrome the error message output the actual property name, whereas now it says, "Symbol(formatted stack trace)". I should note that we are using the callbacks version of the runtime.
I've narrowed the problem down to the way Streamline replaces the stack property. It attempts to get the existing 'stack' getter like so: var getter = e.__lookupGetter__("stack");
In the newest version of Chrome this does indeed return what appears to be a getter function, but then when the getter is executed in the replacement getter:

e.__defineGetter__("stack", function() {
  return formatStack(e, getter());
});

it returns this text: TypeError: Cannot read property 'Symbol(formatted stack trace)' of undefined
A workaround is to pass in the original Error object as 'this' to the getter:

e.__defineGetter__("stack", function() {
  return formatStack(e, getter.call(e));
});

That seems to do it in my version of Chrome anyway.

@bjouhier
Copy link
Member

You nailed it. Can you submit the fix as a pull request?

anodos added a commit to anodos/streamlinejs that referenced this issue Oct 21, 2014
@anodos
Copy link
Contributor Author

anodos commented Oct 21, 2014

I created a pull request (#243). Let me know if you need anything else.

bjouhier added a commit that referenced this issue Oct 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants