-
Notifications
You must be signed in to change notification settings - Fork 72
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
Lenient stackTraceLimit works across browsers #591
Conversation
0246c75
to
90ae1a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a glance, I don't see anything wrong, but I'm not confident I could maintain this, so I'm inclined to leave it to others.
023acb7
to
d2caeb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me, but I'll defer to @michaelfig or @kriskowal as the real experts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
73c1c04
to
aaf25fa
Compare
aaf25fa
to
3eb49fd
Compare
Fixes #525
Using #590 to iterate within several browsers, I repaired several issues.
Error.stackTraceLimit
was failing in non-v8-based browsers becauseError
had no such property and is frozen. Although the property is indeed non-standard and absent in non-v8 systems, Google's documentation encourages assignments to it anyway. This is a noop elsewhere, but is harmless whenError
is unfrozen. To accommodate this practice, this PR installs a noopError.stackTraceLimit
accessor property on every platform. It is a noop everywhere except in the start compartment of a v8-based platform.DataView
has a non-standard but non-deletableBYTES_PER_ELEMENT
property whose value is a number. Since it is non-deletable but harmless, we added it to our whitelist.Error.prototype.stack
accessor property) and others including Safari using the
error.stack` property if present. Otherwise (such as on XS currently) the default stack remains the empty string.In the process, made the console output more pleasant for the common case of console messages containing only one error argument. For this case, nothing is gained by nesting the error within a group. Removing this extra visual noise helps this common case.
Because I built it using #590 it was easy to build it on #590 , which is fine if #590 gets merged first. If #590 gets delayed, I can make this independently mergeable since it has no logical dependence on #590.