Closed
Bug 1127629
Opened 9 years ago
Closed 9 years ago
"<blah> is not a function" doesn't work for `void ...` expressions
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: fitzgen, Assigned: evilpie)
Details
Attachments
(1 file, 1 obsolete file)
1.74 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
When you try and call a variable that is not a function as a function, you get a helpful message: > f = undefined undefined > f() TypeError: f is not a function For some expressions, you get a helpful message too: > function getF() {} undefined > getF()() TypeError: getF(...) is not a function However, if you have a `void ..` expression, then the error message sucks: > (void 2)() TypeError: undefined is not a function I'd expect it to be something like "TypeError: (void ...) is not a function". Are there other cases that produce bad error messages as well?
Comment 1•9 years ago
|
||
This is the expression decompiler, see ExpressionDecompiler::decompilePC. It has some generic code for unary and binary operators, but we don't have a token string for JSOP_VOID in Opcodes.h, that's probably why it doesn't work here. If we added one it'd probably decompile to void(2)...
Assignee | ||
Comment 2•9 years ago
|
||
Or do we always want to decompile, void 0 as `(void 0)`?
Attachment #8567719 -
Flags: review?(jdemooij)
Assignee | ||
Comment 3•9 years ago
|
||
Assignee: nobody → evilpies
Attachment #8567719 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8567719 -
Flags: review?(jdemooij)
Attachment #8567720 -
Flags: review?(jdemooij)
Comment 4•9 years ago
|
||
Comment on attachment 8567720 [details] [diff] [review] void-decompile Review of attachment 8567720 [details] [diff] [review]: ----------------------------------------------------------------- Nice.
Attachment #8567720 -
Flags: review?(jdemooij) → review+
Assignee | ||
Comment 5•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2d7d8a404d0a
Assignee | ||
Comment 6•9 years ago
|
||
There was some problem with my test and --ion-eager, so I changed it to be more specific.
https://hg.mozilla.org/mozilla-central/rev/2d7d8a404d0a
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•