Globalization API working draft

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Nov 2 16:09:25 PDT 2011


On Nov 2, 2011, at 3:00 PM, Nebojša Ćirić wrote:

> We were told (I think by Allen) that setting [[Extensible]] to true would conflict in some way with ES6 modules. I do agree it's a big restriction to set it to false given how JavaScript works today.
> 
> So the question is - are we going to have problems with ES6 Modules is we set this property to true? If so, is there another way of solving this problem?

I do recall that we talked about this at the meeting held at Google, but I don't remember the details.  I'm pretty sure that my first reaction would have been the same as Erik's but we also did talk about module implications.

Ideally, the globalization support would manifest as a global (or properties on an existing global) in ES5 implementations and as a module in ES.next.  Do we know how to actually make that work?

I think we probably have an interesting question for Dave and Sam about how to support version evolution of modules.  Is there a module equivalent of monkey patching. What if we have an implementation that exposes a "V1" module (particularly a built-in module) and code that depends upon upon a V2 of that same module that has an expanded export list.  Is there anyway for that code to patch the module to add the extra exported APIs it would like to use?

Allen  





> 
> 02. новембар 2011. 14.12, Erik Arvidsson <erik.arvidsson at gmail.com> је написао/ла:
> The draft has the following:
> 6	The Globalization Object
> 
> The Globalization object is a single object that has some named properties, all of which are constructors.
> 
> The value of the [[Prototype]] internal property of the Globalization object is the built-in Object prototype object specified by the ECMAScript Language Specification. The value of the [[Extensible]] internal property is false.
> 
> This seems very bad and counter intuitive to how the web works. It would mean that there is no way to fix the Globalization object for browsers that are not fully up to date. Lets assume that in a future version of the spec the Globalization object gains a new property. The standard way to handle this in JS is to do:
> 
> if (!Globalization.newProperty) {
>   Globalization.newProperty = ...;
> }
> 
> This allows people to migrate to new features and it is how people gradually started to use Array extras.
> 
> -- 
> erik
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> 
> 
> 
> 
> -- 
> Nebojša Ćirić
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111102/0eb5c5c5/attachment.html>


More information about the es-discuss mailing list