(There is no spec on "System", just rumors that it will be a predefined,
global instance of Loader).
As far I know the only way to use the es6 module loader without exports or
imports is to set values on 'this', the global object. I guess it's not
very different from using IIFE (function() { this.foo = 2; })(); vs a
module containing the body of the function.
On Fri, Feb 14, 2014 at 11:57 AM, Erik Arvidsson
<[email protected]>wrote:
> On Fri Feb 14 2014 at 2:20:07 PM, C. Scott Ananian <[email protected]>
> wrote:
>
>> Thanks. I was missing the relationship between System and Loader somehow.
>>
>> So System.import is intended to be exactly the same as the import keyword
>> (except promise-returning).
>>
> There is a big difference here. The syntax for import normalizes the name
> and then resolves the name relative to the current module. System.import
> only takes an already normalized name relative to the baseURL. So, you need
> to do the normalization and resolviong manually first. There was a proposal
> to have import do the normalizing and also take an optional referrerName.
> I'm afraid I don't remember what the outcome of that was.
>
>
>> That's good! Is there a way to do without the export keyword as well
>> (I've heard rumors of "anonymous exports" but haven't named to track down a
>> spec)?
>>
> There is a default export. It is just syntactic sugar over exporting and
> importing something with the name `default`.
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss