Importing modules that don't exist

Marius Gundersen gundersen at gmail.com
Fri Nov 21 03:49:41 PST 2014


On Fri, Nov 21, 2014 at 11:49 AM, Andrea Giammarchi <
andrea.giammarchi at gmail.com> wrote:

> a native ImportError seems to me the best option and it's also easy to
> polyfill in a meaningful way with all current module loaders used already
> out there.
>
>
My experience with AMD and require.js is that it is very useful for the
error to include not only the module that couldn't be loaded but also the
module that requested it. These two fields should be on the Error object,
and so a new ImportError with the field `missingModule` and `requestedBy`
(or something similar) sounds like a good solution to me.

Marius Gundersen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141121/43265440/attachment-0001.html>


More information about the es-discuss mailing list