"use es6"; Any plans for such a mode?

Christoph Martens cmartensms at gmail.com
Tue Jul 29 12:02:00 PDT 2014


Hey all,

I just read a bit about the ParallelJS project, Typed Objects 
(StructType) and was curious if I could implement bindings for v8 today.

Link to wiki document: 
http://wiki.ecmascript.org/doku.php?id=harmony:typed_objects


I realized that I don't know what to do if someone has code like this:

typeof uint8; // "undefined" in ES5

This code will be valid in an ES5 environment, because uint8 is an 
undefined reference/variable. But as uint8 is a built-in value type, 
what should happen in an ES6 environment?


*My ideas so far:*

Why not offer something like "use es6"; to offer the same behaviour in 
supported environments? Are there any plans for such a thing? JIT 
implementors could then easily trace if the code was built for ES6 and 
optimize their static code analysis heuristics.

I mean, "use strict" is pretty cool, but it has the problem that it will 
be available among multiple future versions. "use es6" would be an 
identifier a JIT can validate against a specification directly.

Also, you could solve the typeof null; problem with such a thing without 
invalidating legacy code.


Cheers,
~Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140729/17d970d4/attachment.html>


More information about the es-discuss mailing list