Map.prototype.entries receiver check error message needs improvement
Categories
(Core :: JavaScript Engine, enhancement, P5)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox79 | --- | fixed |
People
(Reporter: ljharb, Assigned: evilpies)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15
Steps to reproduce:
Map.prototype.entries.call(true)
Actual results:
throws an error with the message "std_Map_iterator method called on incompatible boolean".
Expected results:
A human-readable message (no underscores, no "std" C++ colloquialisms).
Chrome prints "Method Map.prototype.entries called on incompatible receiver true", Safari prints "Map.prototype.entries requires that |this| be Map". Both are much clearer, and it'd be nice if Firefox picked one of them :-)
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
Thanks! To be honest I don't think I really like either of these messages. Ours is of course worse, because we don't even mention Map.prototype. This is sadly a general problem with how the infamous CallNonGenericMethod function works. I am only going to fix the leakage of our internal self-hosted function name here. This also applies to Set methods. I suspect we have other instances of this problem.
| Assignee | ||
Comment 2•5 years ago
|
||
I think we were defining those methods in self-hosted JS, because that automatically gives
us the property that they all have the same identity. This causes bad error messages.
Instead redefine them in the finishInit ClassSpec hook. We still have the "wrong" methods
in the 'methods' array so that JSXray tests continue to pass.
| Assignee | ||
Updated•5 years ago
|
Comment 4•5 years ago
|
||
| bugherder | ||
Description
•