whatwg/loader

[question] `Instantiation(loader, result, source)` will assume `result` is callable in step 3, but `result` is just an exotic namespace object that is not callable.

Closed this issue · 5 comments

loader.js implementation feedback

resolution: it could be a factory for back-compat with dynamic module systems.

action: it should test for callable or module registry, and act accordingly.

solves as part of refactor #122

image

Does this mean returning a factory in instantiate is no longer supported?

It is supported. Step 4 allows optionalInstance to be callable, then in https://whatwg.github.io/loader/#ensure-linked we guarantee that the factory is executed, and that it returns a namespace exotic object.

Will read more carefully next time. Thanks for clarifying!