tc39 / proposal-await-dictionary

A proposal to add Promise.ownProperties(), Promise.fromEntries() to ECMAScript
MIT License
86 stars 4 forks source link

How should we deal with prototypes on Promise.ownProperties()? #3

Closed ajvincent closed 3 years ago

ljharb commented 3 years ago

"own" typically means enumerable own properties, ie, Object.keys/entries. (Reflect.ownKeys is an exception, but Reflect is weird and i don't think it counts).

ajvincent commented 3 years ago

That's not what I meant. I was thinking more along the lines of Object.create(), where we can specify the prototype of the object we're creating. But such a capability doesn't exist in Object.fromEntries()...

ljharb commented 3 years ago

We explicitly decided not to do that in Object.fromEntries, and I assume we'd want the same decision here. Inheritance is done via class extends; the ES5 attempt to introduce the Object.create patterns never went anywhere.