So today I was thinking about the possibility of having the module instance
object be a function. If it were a function with fairly simple code to
check if the default exports is also a function and if so then apply-invoke
it then you would have a much more useful module instance object.

If you were to do this then either changing it so the unnamed import
returned the module instance object/function instead of the default export
OR using the new `import * as mod from "module"` syntax would get you what
you want much more often than previously.

Here's a gist with kind of what I am saying:

https://gist.github.com/matthewrobb/1cfd9e10f8d70d4fb524

There are a few limitations to this like some of the non-configurables of
functions but it's possible it could instead be a proxy that supports a
call trap or what have you.

Just a thought and I'm sure there are good reasons it's a stupid thought,
just figured I'd rather know why than say nothing.

- Matthew Robb
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to