Choosing Globalization API namespace

Nebojša Ćirić cira at google.com
Thu Nov 17 14:35:46 PST 2011


>
> Nit: still would want the @, so '@globalization' or something shorter.
> '@locale'?
>

I was just making sure I got your idea right. I'll use @ in the future.


> That's a good start at a shim hack. Better still would be to work
> incrementally to eliminate the v8Locale global property.
>

Chrome loads v8 extensions on startup (and i18n is one of those), so
v8Locale becomes available from get go. I expect that behavior to go away
with further development of the module system.


> The module loader load method, IIRC, takes a callback that is invoked with
> the module object passed as the sole parameter. This is necessary for
> loading modules from "slow media" (filesystem, web, etc.), but for a
> built-into-the-browser system library, perhaps it could be avoided. Anyway,
> from what I recall of the module loaders API, you'd want:
>
> Object.system.load = function(name, callback) {
>   if (name === 'Globalization') {
>     callback(v8Locale);
>   }
> };
>
> The burden is on us in TC39 to get module loaders and such spec'ed harder,
> drafted, and then prototype-implemented. But if you can play along, it
> shouldn't require more than a little shimming IMHO.
>

Callback sounds good. Even for system libraries you may encounter delay if
engine decides to load them on demand (say from dll).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111117/c84158a7/attachment.html>


More information about the es-discuss mailing list