Importing modules that don't exist

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Nov 13 10:29:20 PST 2014


On Nov 13, 2014, at 5:16 AM, Calvin Metcalf wrote:

> It should throw a static error, the loader is where this is specified I believe, but it looks like the loader was pulled out into it's own spec https://github.com/rwaldron/tc39-notes/blob/b1af70ec299e996a9f1e2e34746269fbbb835d7e/es6/2014-09/sept-25.md#loader-pipeline, not sure where that ended up living.
> 
> On Thu, Nov 13, 2014 at 7:37 AM, Isiah Meadows <impinball at gmail.com> wrote:
> What happens if a module isn't able to be found? Is that implementation defined, or have I missed it in the spec?
> 
> 

See http://people.mozilla.org/~jorendorff/es6-draft.html#sec-stati-semantics-parsemoduleandimports-realm-modulename.-visited steps 10 and 11.  If the "host" can not provide the source for a module (as would be the case if the module name is invalid or the module is missing) HostGetSource is supposed to throw an throw an exception.  However, the actual exception that is thrown in that case is not currently specified.

For an invalid name in an import declaration, this would occur during a recursive call to ParseModu8leAndImports, stoep 17.d

Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141113/dd9372d0/attachment.html>


More information about the es-discuss mailing list