Closed
Bug 808340
Opened 13 years ago
Closed 8 years ago
Destructuring assignments can return confusing error messages
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: miker, Unassigned)
References
(Blocks 1 open bug)
Details
The following results in the error "values() is undefined":
function notvalues() {
return [1, 2, 3];
}
let [x, y, z] = values();
This is to be expected but the following produces the same error even though values is defined:
function values() {
return;
}
let [x, y, z] = values();
Maybe we could return something like "Unable to deconstruct return value."
Assignee | ||
Updated•11 years ago
|
Assignee: general → nobody
Comment 1•9 years ago
|
||
> function notvalues() {
> return [1, 2, 3];
> }
>
> let [x, y, z] = values();
current error message is "ReferenceError: values is not defined",
on today's nightly.
> function values() {
> return;
> }
>
> let [x, y, z] = values();
and "TypeError: values(...) is undefined" for this.
I think they're clear enough now.
Comment 2•8 years ago
|
||
Resolving as WFM per comment #1.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•