Closed Bug 878432 Opened 11 years ago Closed 11 years ago

OdinMonkey accepts over-parenthesized return statement, which is disallowed by spec

Categories

(Core :: JavaScript Engine, defect)

x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: testcase)

js> (function() { "use asm"; function f(i) { i=i|0; return (i|0); } return f; })
warning: successfully compiled asm.js code
function () {
    [native code]
}

http://asmjs.org/spec/latest/#return-type-annotations requires the entire return statement to have the form "return ...|0;".

Not sure if OdinMonkey or spec should be changed.
The intention (which doesn't seem to appear in the spec, probably we should add that) is that parens are ignored for the purposes of asm.js type checking.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.