Rick Waldron (2013-12-18T03:06:01.000Z)
On Tue, Dec 17, 2013 at 8:17 PM, Brendan Eich <brendan at mozilla.com> wrote:

> It's now or never. I agree multiple sources are useful enough to do now; I
> don't see a different third parameter that would be precluded by deciding
> this. But others may disagree.
>

A third Properties argument that matches the second Properties argument to
Object.create() and Object.defineProperties

class Cycle {
  constructor(details) {
    Object.assign(this, details, {
      wheels: {
        value: details.type === "tricycle" ? 3 : 2,
        configurable: false,
        writable: false
      }
    });
  }
}

var trike = new Cycle({
  color: "red",
  type: "tricycle"
});

... Which doesn't break the reduce pattern since the index would
effectively be meaningless in that context, ie.
Object.getOwnPropertyNames(Object(1)).length === 0;

Anyway...I had originally pushed for Object.assign with multiple sources
and dropped it when consensus seemed to hinge on "one target, one source".
The third Properties argument is compelling and doesn't prevent using
Object.assign as a primitive mechanism for library code to build on top of.

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131217/dfb7e6bb/attachment.html>
domenic at domenicdenicola.com (2013-12-18T03:45:15.360Z)
On Tue, Dec 17, 2013 at 8:17 PM, Brendan Eich <brendan at mozilla.com> wrote:

> It's now or never. I agree multiple sources are useful enough to do now; I
> don't see a different third parameter that would be precluded by deciding
> this. But others may disagree.
>

A third Properties argument that matches the second Properties argument to
Object.create() and Object.defineProperties

```js
class Cycle {
  constructor(details) {
    Object.assign(this, details, {
      wheels: {
        value: details.type === "tricycle" ? 3 : 2,
        configurable: false,
        writable: false
      }
    });
  }
}

var trike = new Cycle({
  color: "red",
  type: "tricycle"
});
```

... Which doesn't break the reduce pattern since the index would
effectively be meaningless in that context, ie.
Object.getOwnPropertyNames(Object(1)).length === 0;

Anyway...I had originally pushed for Object.assign with multiple sources
and dropped it when consensus seemed to hinge on "one target, one source".
The third Properties argument is compelling and doesn't prevent using
Object.assign as a primitive mechanism for library code to build on top of.