tc39 / proposal-defer-import-eval

A proposal for introducing a way to defer evaluate of a module
https://tc39.es/proposal-defer-import-eval
MIT License
208 stars 12 forks source link

Questions about import defer * have to add a new DeferredNamespace #45

Open LMM-7xyx opened 1 month ago

LMM-7xyx commented 1 month ago

I don't queit understand “Why import defer gives a different namespace object from import ” section,is there any problem in the example?It seems that the import file "module-that-throws" doesn't match any file in the example, makes me confuse why defer import doesn't throw error.

Jack-Works commented 1 month ago

see https://github.com/tc39/proposal-defer-import-eval/pull/43

nicolo-ribaudo commented 1 month ago

module-that-throws would be a file with these contents:

throw new Error();

It doesn't throw when you do import defer because it doesn't evaluate the module.