Closed Bug 452561 Opened 16 years ago Closed 15 years ago

Function decompiles into one with "SyntaxError: invalid object initializer" (involves destructuring assignment and ?:)

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: testcase)

js> function f() { [a] = 1 ? function(){} : [b] }
js> f
function f() {
    [a] = function () {};
}

js> eval("(" + f + ")")
typein:4: SyntaxError: invalid object initializer:
typein:4:     [a] = function () {};
typein:4: ......................^

SpiderMonkey should either accept both, reject both, or not turn the former into the latter.  I think accepting both makes the most sense, but I don't know the ecmascript parsing requirements.

(Tracemonkey branch, jit disabled.)
WFM.  The decompilation is unchanged from when I reported this bug, but it is now accepted.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.