On May 29, 2011, at 2:58 PM, Thaddee Tyl wrote:
> ... I believe that, given the fact that browsers will implement
> ES.next incrementally, we should find a way to allow graceful
> fallback, rather than version-driven conditionals.
This is trivial for new global object properties, but such additions in the
past, even including JSON, have been breaking changes for some web sites. With
the module system in ES.next we are probably instead going to add standard
modules named by anti-URI module resource locators such as "@name", and thereby
avoid polluting the global object, or even the Object constructor.
But say we do add, e.g. Object.createPrivateName(name, visible). That will be
detectable using good old "object detection" -- no need for a "features" object
as you show.
> The fact that Harmony features are already batched up makes this easy;
> maybe we can use a different use-pragma that already defined.
> Something like an object literal. Object literals are so cool.
>
> if (features.es6.proxies) {
How is this better or different from any version-driven conditional? It's not,
at least not up until the second dot.
Authors will want to object-detect APIs expressed as built-in objects, but
other features including new syntax cannot be handled easily or at all that
way, and many authors will want the whole pie.
/be_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss