Closed
Bug 354921
Opened 19 years ago
Closed 13 years ago
Better error messages for destructuring-assignment failures
Categories
(Core :: JavaScript Engine, enhancement)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: jruderman, Unassigned)
References
(Blocks 1 open bug)
Details
({a:{c:x}, b:x}) = ({b:3})
TypeError on line 1: undefined has no properties
[[x]] = 6;
TypeError on line 1: undefined has no properties
I think these could use more specific error messages.
(Split from bug 346642.)
| Reporter | ||
Comment 1•17 years ago
|
||
Destructuring arguments could use better error messages, too:
js> (function([y]){})()
typein:1: TypeError: arguments[0] is undefined
| Reporter | ||
Comment 2•17 years ago
|
||
The error messages from comment 0 have changed, becoming even more confusing in this context.
js> [[x]] = 6;
typein:2: TypeError: (void 0) is undefined
Comment 3•17 years ago
|
||
Any idea of when this regressed?
/be
| Reporter | ||
Comment 4•17 years ago
|
||
I assume it's a combination of bug 375801 and bug 353116, but I haven't tested.
Comment 5•13 years ago
|
||
This seems pretty good:
js> ({a:{c:x}, b:x}) = ({b:3})
typein:14:1 TypeError: (intermediate value).a is undefined
js> [[x]] = 6;
typein:15:0 TypeError: 6[0] is undefined
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•