Closed Bug 404734 Opened 17 years ago Closed 17 years ago

Implement object destructuring shorthand for JS1.8

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9beta3

People

(Reporter: brendan, Assigned: brendan)

References

Details

(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])

Attachments

(1 file, 2 obsolete files)

var {p, q} = o; short for var {p:p, q:q} = o; where o = {p: 42, q: true}. /be
Want this for JS1.8 (JS2/ES4 proving). /be
Status: NEW → ASSIGNED
Flags: blocking1.9+
Attached patch implementation (obsolete) (deleted) — Splinter Review
This added side-trip is easy, if you know the territory already ;-). /be
Attachment #295144 - Flags: review?(mrbkap)
Warming up a bit with a small patch, hence elevated priority. /be
Priority: -- → P1
Target Milestone: mozilla1.9 M10 → mozilla1.9 M11
Comment on attachment 295144 [details] [diff] [review] implementation Incomplete, need consensus from Ecma TG1 based on http://bugs.ecmascript.org/ticket/111#comment:3. /be
Attachment #295144 - Flags: review?(mrbkap) → review-
The only forward progress to report is approval of destructuring shorthand and the desire to separate object initialiser shorthand that mirrors the destructuring shorthand into a separate bugs.ecmascript.org trac ticket. I don't favor such a "structuring" shorthand at the moment, so don't plan to implement it. Since the destructuring shorthand is approved, I would like to finish this bug by adding the necessary post-parsing AST check for lvalue context. /be
Attachment #295144 - Attachment is obsolete: true
Attachment #299869 - Flags: review?(mrbkap)
Comment on attachment 299869 [details] [diff] [review] shorthand is for destructuring only (not "structuring" aka object literal) I only skimmed the decompiler changes. Do those JS_ASSERTS want to be LOCAL_ASSERTs?
Attachment #299869 - Flags: review?(mrbkap) → review+
Attachment #299869 - Attachment is obsolete: true
Attachment #300269 - Flags: review+
Attachment #300269 - Flags: approval1.9+
Fixed: js/src/js.msg 3.83 js/src/jsconfig.h 3.46 js/src/jsemit.c 3.299 js/src/jsopcode.c 3.285 js/src/jsparse.c 3.331 js/src/jsparse.h 3.58 /be
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
/cvsroot/mozilla/js/tests/js1_8/regress/regress-404734.js,v <-- regress-404734.js initial revision: 1.1
Flags: in-testsuite+
Flags: in-litmus-
v
Status: RESOLVED → VERIFIED
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
Finally put together https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment which contains info on destructuring in the light of ES6. Marking this as dev-doc-complete.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: