Closed Bug 1066414 Opened 12 years ago Closed 12 years ago

Assertion failure: opn->isArity(PN_NAME), at frontend/ParseNode.cpp

Categories

(Core :: JavaScript Engine, defect)

x86_64
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla35
Tracking Status
firefox35 --- affected

People

(Reporter: gkw, Assigned: Swatinem)

References

Details

(Keywords: assertion, regression, testcase, Whiteboard: [jsbugmon:update])

Attachments

(2 files)

for (var [...y] in Object) {} asserts js debug shell on m-c changeset bc7deafdac4b without any CLI flags at Assertion failure: opn->isArity(PN_NAME), at frontend/ParseNode.cpp. Debug configure flags: CC="clang -Qunused-arguments" CXX="clang++ -Qunused-arguments" AR=ar sh /Users/skywalker/trees/mozilla-central/js/src/configure --target=x86_64-apple-darwin12.5.0 --enable-debug --enable-optimize --enable-nspr-build --enable-more-deterministic --with-ccache --enable-gczeal --enable-debug-symbols --disable-tests autoBisect shows this is probably related to the following changeset: The first bad revision is: changeset: https://hg.mozilla.org/mozilla-central/rev/5c2363e6e9ad user: Arpad Borsos date: Fri Aug 22 10:16:58 2014 +0200 summary: Bug 933276 - Implement [...x] in assignment target (spread operator); r=jorendorff Jason, is bug 933276 a possible regressor?
Flags: needinfo?(jorendorff)
That might as well be the cause. I will take a look. A call stack would be helpful though.
Attached file stack —
Oops, forgot the stack, so here it is for m-c rev 2db5b64f6d49.
Interesting. The stack does not include any of the functions I touched. Is it that cloneLeftHandSide simply can’t deal with the new rest syntax (yet?). I’ll take a look.
This fixes the assert at least. Still need to figure out what the correct behavior here is. for (var [...x] in [1,2,3]) yields "2" for x. Need to read up in the spec on this.
Attachment #8488515 - Flags: review?(jorendorff)
Assignee: nobody → arpad.borsos
Status: NEW → ASSIGNED
meh, the code is indeed correct. A string is iterable (since when? I haven’t seen that before), so it yields an array with each char. If you want, I can add tests for that.
Comment on attachment 8488515 [details] [diff] [review] part1: fix assertion Review of attachment 8488515 [details] [diff] [review]: ----------------------------------------------------------------- Nicely done, thank you.
Attachment #8488515 - Flags: review?(jorendorff) → review+
Flags: needinfo?(jorendorff)
(In reply to Arpad Borsos (Swatinem) from comment #5) > meh, the code is indeed correct. A string is iterable (since when? I haven’t > seen that before), so it yields an array with each char. Right. This changed in rev 26: https://bugs.ecmascript.org/show_bug.cgi?id=2884 but I think we implemented it that way before it was technically correct to do so... > If you want, I can add tests for that. Sounds good! Passing tests are always welcome. :)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: