jorendorff / js-loaders

Pseudoimplementation of the proposed ES6 module loaders.
54 stars 7 forks source link

Semantics of import ModuleSpecifier #61

Closed arv closed 10 years ago

arv commented 10 years ago

The ES wiki states that:

ImportDeclaration ::= "import" ImportSpecifierSet "from" ModuleSpecifier ";"      // explicit import declaration (fetch and execute dependency)
                   |  "import" ModuleSpecifier ";"                                // implicit import declaration (fetch dependency only)

Especially the "fetch only" part. How can I come to that conclusion based on the current spec draft?

The semantics of import {} from 'name' is to execute. How is this propagated through? I feel like there is some flag/argument that might not be passed through somewhere.

zenparsing commented 10 years ago

Why are we including a pre-fetching feature at the level of static linking semantics? This is a clear violation of stratification. What is the justification for this choice?

jorendorff commented 10 years ago

The wiki is wrong. import "name"; is equivalent to import {} from "name"; in the proposed spec.

samth commented 10 years ago

I've fixed the wiki.