Node v0.10.20 provides many options pertaining to harmony,
--harmony_typeof (enable harmony semantics for typeof)
--harmony_scoping (enable harmony block scoping)
--harmony_modules (enable harmony modules (implies block scoping)
--harmony_proxies (enable harmony proxies)
--harmony_collections (enable harmony collections (sets, maps, and weak maps))
--harmony (enable all harmony features (except typeof))
I understand that these are not production-ready features and that they're under development, but many of them are good enough.
Is there a way to enable them at runtime?
"use strict";
"use harmony collections";
Something like the above. Even if it's not just module-level enabling of those features, it'd be nice to ensure they were enabled inside the module rather than assume they were enabled.
No, you can't. In fact, some things might potentially go horribly wrong within V8 internals if you tried to sneak in multiple different settings of these flags within the same V8 instance (disclosure: I implemented most of these flags).
There is no way to do this, the interpreter reads the content of the modules then validate them and then evaluate them. If you will use some ES6 specific syntax then the validation will fail and the code will not be evaluated.
You only could isolate the ES6 syntax files and run them as child processes (with the necessary options), but I guess this is not the way you want to do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With