Closed
Bug 877908
Opened 11 years ago
Closed 11 years ago
Confusing error message from "use asm" with "use strict"
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: jruderman, Assigned: bbouvier)
Details
(Keywords: testcase)
Attachments
(1 file, 1 obsolete file)
2.62 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
js> (function() { "use asm"; "use strict"; function g(){} return g; }) typein:14:0 warning: asm.js type error: asm.js module must end with a return export statement: typein:14:0 warning: (function() { "use asm"; "use strict"; function g(){} return typein:14:0 warning: .^ Expected one of the following: * "use asm" precludes other directives * unsupported kind of statement in asm.js module
Assignee | ||
Comment 1•11 years ago
|
||
The asmjs spec is not precise whether the use of "use asm" should preclude other directives, so this patch stays consistent with the rest of the function.
Reporter | ||
Updated•11 years ago
|
Summary: Confusing error message from "use asm" → Confusing error message from "use asm" with "use strict"
Comment 2•11 years ago
|
||
Comment on attachment 756786 [details] [diff] [review] proposed fix + test Review of attachment 756786 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! ::: js/src/ion/AsmJS.cpp @@ +2574,5 @@ > + *stmtIter = NextNonEmptyStatement(firstStatement); > + if (*stmtIter > + && IsExpressionStatement(*stmtIter) > + && ExpressionStatementExpr(*stmtIter)->isKind(PNK_STRING)) > + return m.fail(*stmtIter, "\"use asm\" precludes other directives"); SM style is, when the condition is multi-line, { brace } the then branch, even if it is a single line (with the opening { on a new line). So, if (.... ...) { return ... }
Attachment #756786 -
Flags: review?(luke) → review+
Assignee | ||
Comment 3•11 years ago
|
||
Carrying r+ with fixed nit.
Attachment #756786 -
Attachment is obsolete: true
Attachment #759393 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Whiteboard: checkin-needed
Comment 5•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/0a027c965a33
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in
before you can comment on or make changes to this bug.
Description
•