Open Bug 1771690 Opened 3 years ago Updated 3 years ago

Nested array make misleading error message

Categories

(Core :: JavaScript Engine, defect, P3)

Firefox 100
defect

Tracking

()

Tracking Status
firefox-esr91 --- wontfix
firefox101 --- wontfix
firefox102 --- wontfix
firefox103 --- fix-optional

People

(Reporter: 845043157, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0

Steps to reproduce:

Run the program:
[i,[j]]=[123,456];

Actual results:

TypeError:[123,456]Symbol.iterator.next().value is not iterable

Expected results:

In V8, it throws "TypeError:number 456 is not iterable (cannot read property Symbol(Symbol.iterator))".
I think it is 456 instead of [123,456] need to be iterable,the error message in V8 may be better.

The Bugbug bot thinks this bug should belong to the 'Core::JavaScript Engine' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → JavaScript Engine
Product: Firefox → Core

The expression decompiler tries to provide the code, but the Symbol.iterator access and next access/call are generated internally, and not in the user-code.
Might be better abort the decompiler when it sees Symbol.iterator access and fallback to actual value on the stack.

Blocks: jserror
Severity: -- → S4
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.