I'm still struggling with this. Does *anyone* know where, in the wild, Module Environments (a type of Lexical Environment) exist?https://twitter.com/padolsey/status/1151148086812696576 …
-
-
Replying to @padolsey
ModuleEnvironment is an abstract spec concept. It doesn’t “exist” in implementations in that there is no user-accessible object that directly corresponds to the concept.
1 reply 0 retweets 0 likes -
Replying to @mathias
Am I right to presume that it would "exist" as a true scope (i.e. an accessible lexical environment in which we could declare things) in Node.js if Node didn't do that weird module wrapping thing as per https://nodejs.org/api/modules.html#modules_the_module_wrapper … ?
2 replies 0 retweets 0 likes -
Replying to @padolsey
I mean, you have that in d8 if you run an *.mjs file (or enable the --module flag). Although d8 comes with its own non-standard built-ins (like `print`, `read`, etc.).
1 reply 0 retweets 1 like -
Same for other JS engines (installable using https://github.com/GoogleChromeLabs/jsvu …). A fun way to check whether your script is running as a module goal is to do this at the top-level: print(this === undefined ? 'module' : 'classic script');
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.