Closed Bug 355023 Opened 13 years ago Closed 13 years ago

destructuring assignment (group assignment) optimized too much

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9alpha1

People

(Reporter: sync2d, Assigned: brendan)

References

Details

(Keywords: verified1.8.1.1)

Attachments

(1 file)

$ js -v 170
js> Array.prototype[0] = 1024;
1024
js> (function(){ var a=[],[x]=a; print(x); })();
1024
js> (function(){ var [x]=[]; print(x); })();
undefined
Summary: destructuring assignment optimized too much → destructuring assignment (group assignment) optimized too much
The special, optimized case of [...] = [...] is called "group assignment", so I added that phrase to the summary.
This can wait for 1.8.1.1.

/be
Flags: blocking1.8.1.1?
With more work and more code, EmitGroupAssignment could budget more stack and emit more code.  Worth it for this hard case?  I think not.

/be
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #240839 - Flags: review?(mrbkap)
Priority: -- → P2
Target Milestone: --- → mozilla1.9alpha
Blocks: js1.7src
Attachment #240839 - Flags: review?(mrbkap) → review+
Fixed on trunk:

Checking in jsemit.c;
/cvsroot/mozilla/js/src/jsemit.c,v  <--  jsemit.c
new revision: 3.223; previous revision: 3.222
done

/be
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Checking in regress-355023.js;
/cvsroot/mozilla/js/tests/js1_7/regress/regress-355023.js,v  <--  regress-355023.js
initial revision: 1.1
done
Flags: in-testsuite+
verified fixed 1.9 20061007 windows/linux
Status: RESOLVED → VERIFIED
Flags: blocking1.8.1.1? → blocking1.8.1.1+
Comment on attachment 240839 [details] [diff] [review]
simple but suboptimal fix

approved for 1.8 branch, a=dveditz for drivers
Attachment #240839 - Flags: approval1.8.1.1+
Fixed on the 1.8 branch:

Checking in jsemit.c;
/cvsroot/mozilla/js/src/jsemit.c,v  <--  jsemit.c
new revision: 3.128.2.56; previous revision: 3.128.2.55
done

/be
Keywords: fixed1.8.1.1
verified fixed 20061122 1.8.1.1 windows/linux/mac, 1.9 windows/linux
You need to log in before you can comment on or make changes to this bug.