paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 389 forks source link

Revise ES6 Construct (Promise,Map,Set) to follow latest spec #303

Open ljharb opened 9 years ago

ljharb commented 9 years ago

https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L161-L174 no longer applies, since as of Rev 28 @@create no longer exist.

Should we thus remove this function?

domenic commented 9 years ago

Subclassing is still supported though.

ljharb commented 9 years ago

Definitely - how can we shim the act of calling the [[CreateAction]] internal slot?

cscott commented 9 years ago

Yeah, it needs to stay there until I revise the Promise implementation to follow the latest spec. Our @@create methods were used to ensure that Map and Set etc also support subclassing; we need to come up with a unified solution for that. Probably with a hidden field named literally [[CreateAction]] or something like that.

In the meantime, I think having the correct externally-visible operation (as we do now) is more important than whether our implementation follows the naming of spec-internal methods. Unless someone can point to a concrete externally-visible ES6 behavior that we are misbehaving on?

ljharb commented 9 years ago

Relates to #239.

ljharb commented 9 years ago

@cscott any update on this one?