Closed
Bug 404484
Opened 18 years ago
Closed 18 years ago
destructuring assignment does not work for constants
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.7R1
People
(Reporter: mozilla.bugs, Assigned: norrisboyd)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
Build Identifier: CVS HEAD
Destructuring assignment works fine for "var" and "let" but not for "const".
Reproducible: Always
Steps to Reproduce:
const [a, b] = [1, 2];
Actual Results:
a and b are defined as consts whose values are "undefined".
Expected Results:
a and b are defined as consts and a == 1 and b == 2.
| Reporter | ||
Comment 1•18 years ago
|
||
My understanding of the compiler work is that:
const [a, b] = [1, 2];
is transformed in:
const a, b;
{
let $0 = [1, 2];
a = $0[0];
b = $0[1];
}
| Assignee | ||
Updated•18 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
| Assignee | ||
Updated•18 years ago
|
Assignee: nobody → norrisboyd
Status: ASSIGNED → NEW
| Assignee | ||
Comment 3•18 years ago
|
||
Fixed:
Checking in IRFactory.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/IRFactory.java,v <-- IRFa
ctory.java
new revision: 1.113; previous revision: 1.112
done
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Summary: destructuring assignement does not work for constants → destructuring assignment does not work for constants
| Reporter | ||
Comment 4•18 years ago
|
||
thanks
You need to log in
before you can comment on or make changes to this bug.
Description
•