Add Stack Accessor Telemetry
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox136 | --- | fixed |
People
(Reporter: mgaudet, Assigned: dminor)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
https://github.com/ljharb/proposal-error-stack-accessor/ is a proposal for a standard Error.prototype.stack accessor
We diverge from the standard text in at least couple of ways, but we should try and identify via telemetry how important these divergences are:
- Our getter walks the proto chain itself, looking for anything with an
[[ErrorData]]internal slot (aka, hunting forErrorObjectinstance). Standard getter would just checkthis - There's interest in making the setter throw on a non-string input: How often is that done?
- The setter is specced to throw if it doesn't have an ErrorData internal slot... how often does that happen?
A good model for this patch would be https://phabricator.services.mozilla.com/D233438
| Assignee | ||
Updated•1 year ago
|
| Reporter | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
This adds five new use counters to determine whether the error
stack accessor proposal would be web compatible. It counts each
use of the Error.stack getter and setter. It also tracks if the
this object doesn't have an [[ErrorData]] slot, a situation that
currently works, but under the new proposal, would no longer
access the stack. Finally, it tracks attempts to set Error.stack to
a non-string value, something that would throw under the new proposal.
It was manually tested in the developer console using code like this:
var e = new Error()
e.stack
e.stack = "hi"
var e2 = new Error()
e2.stack = 42
var obj = Object.create(Error.prototype)
obj.stack
obj.stack = "hi"
Note that the Error.isError proposal added [[ErrorData]] to
DOMException, but this is excluded from this telemetry. Testing
was done with instances of DOMException to ensure it would not affect
these results.
Comment 3•1 year ago
|
||
| bugherder | ||
Description
•