Closed Bug 354921 Opened 19 years ago Closed 13 years ago

Better error messages for destructuring-assignment failures

Categories

(Core :: JavaScript Engine, enhancement)

PowerPC
macOS
enhancement
Not set
normal

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.)
Destructuring arguments could use better error messages, too: js> (function([y]){})() typein:1: TypeError: arguments[0] is undefined
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
Any idea of when this regressed? /be
I assume it's a combination of bug 375801 and bug 353116, but I haven't tested.
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.