Generator and array comprehensions should support destructuring binding

RESOLVED WONTFIX

Status

()

defect
RESOLVED WONTFIX
5 years ago
18 days ago

People

(Reporter: wingo, Unassigned)

Tracking

({feature})

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
The first version of ES6 array and generator comprehensions (bug 979865) does not do destructuring binding.  It should.
OS: Mac OS X → All
Hardware: x86 → All
Whiteboard: [js:p1]

Comment 1

4 years ago
This may be handy in cases like this (from bug 1164028):

  events: {
    mainview: {
      focus(event) {},
    },
    filter: {
      input(event) {},
    },
  },

So, instead of:

  this.boundEventHandlers = [
    for (elementName of Object.keys(this.events))
    for (eventName of Object.keys(this.events[elementName]))
    [elementName, eventName, this.events[elementName][eventName].bind(this)]
  ];

I could use:

  this.boundEventHandlers = [
    for ([elementName, events] of Iterator(this.events))
    for ([eventName, handler] of Iterator(events))
    [elementName, eventName, handler.bind(this)]
  ];

However, I'm not sure what is the standard alternative to Iterator in this case...
Not an ES6 feature anymore; detaching from that dependency tree.
No longer blocks: es6
Summary: ES6 generator and array comprehensions should support destructuring binding → Generator and array comprehensions should support destructuring binding
Whiteboard: [js:p1]

Comment 3

5 months ago
This is not standard and i have not seen a corresponding proposal in https://github.com/tc39/proposals
This bug should probably be closed and a new one re-opened when a proposal emerges and reaches stage 2 or 3 (or there is interest from the SpiderMonkey team to experiment before that)

Comment 4

5 months ago
Also, Generator and array comprehensions were removed somewhere in bug 1220564 and bug 1414340
Status: NEW → RESOLVED
Last Resolved: 18 days ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.