Closed
Bug 1241966
Opened 8 years ago
Closed 7 years ago
Better error when assigning to primitives in strict mode
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: evilpie, Assigned: evilpie)
References
(Blocks 2 open bugs)
Details
(Keywords: dev-doc-needed)
Attachments
(1 file, 1 obsolete file)
6.13 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
Jason:
> But what is up with that error message?
>
> typein:1:15 TypeError: can't assign to properties of (new
> Boolean(true)): not an object
>
> WAT!
I looked into this before and the way we delay reporting the error message with ObjectOpResult probably requires some special casing for this.
Updated•8 years ago
|
Flags: needinfo?(jorendorff)
Comment 2•8 years ago
|
||
Low priority but I'd like to do this...
Assignee: nobody → jorendorff
Flags: needinfo?(jorendorff)
Assignee | ||
Comment 3•7 years ago
|
||
Looking at nbp's counters for error messages (https://nbp.github.io/arewedocumentedyet/), this is actually relatively high.
Assignee | ||
Comment 4•7 years ago
|
||
We already know the the value originally was a primitive, so we might as well just unbox it. This is a bit of a hack, but at least we don't need to rejigger ObjectOpResult for this special case.
Assignee: jorendorff → evilpies
Status: NEW → ASSIGNED
Attachment #8912192 -
Flags: review?(jorendorff)
Assignee | ||
Updated•7 years ago
|
Attachment #8912192 -
Flags: review?(jorendorff) → review?(jdemooij)
Comment 5•7 years ago
|
||
Comment on attachment 8912192 [details] [diff] [review] Unbox non-object receiver for error reporting Review of attachment 8912192 [details] [diff] [review]: ----------------------------------------------------------------- Nice. Add a test for a number of different primitives, to make sure we don't regress this? Checking the exact error message is fine probably.
Attachment #8912192 -
Flags: review?(jdemooij) → review+
Assignee | ||
Comment 6•7 years ago
|
||
Sorry I should have written a test for this before. So I found out that we need to allow unboxing Symbol objects as well. This shouldn't change any behavior, because other callers check the object class before unboxing.
Attachment #8912192 -
Attachment is obsolete: true
Attachment #8913993 -
Flags: review?(jdemooij)
Comment 7•7 years ago
|
||
Comment on attachment 8913993 [details] [diff] [review] v2 Unbox non-object receiver for error reporting Review of attachment 8913993 [details] [diff] [review]: ----------------------------------------------------------------- Good catch.
Attachment #8913993 -
Flags: review?(jdemooij) → review+
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/417c277c6853 Unbox non-object receiver for better error reporting. r=jandem
Assignee | ||
Updated•7 years ago
|
Keywords: dev-doc-needed
Comment 9•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/417c277c6853
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•