Closed littledan closed 8 years ago
Typically, engines only ship a well-known symbol when it's fully implemented. es6-shim
does have an internal addDefaultSpecies
method which won't be tripped up by some of them existing and some not - but I don't think we currently do runtime tests for all of the relevant methods - so we'd probably have to add a bunch of those checks to patch all the methods v8 hadn't gotten to yet.
What's the advantage of shipping it piecemeal?
Shipping it piecemeal might get parts of it sooner. Arrays are a bit more complicated to ship for performance reasons. If you think it'll break existing deployments if it's shipped piecemeal, then that's a decent argument for delaying shipping until the symbols is fully implemented.
It's really hard for me to estimate since I haven't dug into the species stuff yet.
In general, I don't think any well-known symbol (even iterator) is a good idea to enable unless all parts of it are there. Could the species stuff go behind a flag until it's all ready?
Sure, it'll just be unavailable to users for longer then. In general, ES2015 is only partly done, and we're shipping it piecemeal. But if this should go as a package, then that's that.
Closing for now, please let me know if there are further questions/updates.
If V8 shipped the Symbol.species property on different objects in different releases, would ES6-shim be able to cope well with that, or would it get tripped up, imagining that the 'species' property on Symbol implied that Arrays had all of the logic in their methods?