Globlization and Object.system.load

David Herman dherman at mozilla.com
Thu Nov 17 15:57:40 PST 2011


On Nov 17, 2011, at 3:48 PM, Roozbeh Pournader wrote:

> On Thu, Nov 17, 2011 at 3:08 PM, Roozbeh Pournader <roozbeh at google.com> wrote:
>> That would make something like this the minimum code needed to use the module:
>> 
>> var g11n;
>> Object.system.load("@g11n", function (g11n_module) {
>>   g11n = g11n_module;
>> });
> 
> I guess I was wrong about the minimum code. The minimum code is
> something like this:
> 
> Object.system.load("@g11n", function (g11n) {
>  // put all the code that uses g11n in here
> });
> 
> I actually like this. I think I should just take back my comment...

I agreed with you before. :) When you know for sure that it can't block, you should have a synchronous API. Something like:

    var g11n = Object.system.loaded["@g11n"];

Dave



More information about the es-discuss mailing list