Closed Bug 404484 Opened 18 years ago Closed 18 years ago

destructuring assignment does not work for constants

Categories

(Rhino Graveyard :: Core, defect)

x86
Windows XP
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

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.
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]; }
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee: nobody → norrisboyd
Status: ASSIGNED → NEW
Set target milestone to 1.7R1.
Target Milestone: --- → 1.7R1
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
thanks
You need to log in before you can comment on or make changes to this bug.