ES6 plans
Jump to navigation
Jump to search
Harmony infrastructure
- New SM version number
- Opt-in via type="text/ecmascript;version=6" or whatever - bug 694107
- Per-script opt-in syntax ('use harmony;' or whatever)
- Opt-in via HTTP header?
- Whole-page opt-in via HTML feature?
Modules
Modules are bug 568953.
module
syntax, scoping semantics, module objectsimport
syntaxfrom "url"
syntax- Hook up
from "url"
and async module loading to Gecko - Module loaders
New APIs that are in modules
- Reorganize the standard library into modules
- Private name objects - bug 694127
- A few functions for iterating over object properties
New and improved builtin APIs
Most of this stuff does not need to touch a lot of code. Pretty good fodder for newbies.
- Simple Maps and Sets - The spec is incomplete but I will be landing what's there now in bug 697479.
- Binary data - bug 578700
- New reflection methods Object.getPropertyDescriptor, Object.getPropertyNames
- Two more methods are proposed here: [strawman:extended_object_api http://wiki.ecmascript.org/doku.php?id=strawman:extended_object_api]
- Number.isFinite, isNaN, isInteger, and toInteger
- String.prototype.repeat, startsWith, endsWith, contains, toArray
- New reflection API that complements proxies: [harmony:reflect_api http://wiki.ecmascript.org/doku.php?id=harmony:reflect_api]
- Object.is, isnt
- More math functions - Proposed are: Math.log10, log2, log1p, expm1, cosh, sinh, tanh, acosh, asinh, atanh, hypot, trunc, sign; perhaps gamma and erf; and perhaps randomInt(n).
- ES6 will spec that Math.random does not share state across multiple globals.
New syntax (stuff that affects the front end and/or bytecode)
is
andisnt
operators- for-of loops - bug 699565 - This is I'd say better than half done. It was easy. XPConnect must be updated so that arraylike XPCOM objects cooperate with for-of.
- Parameter default values
- Rest parameters - bug 574132
- Spread operator - bug 574130 - The operator can appear in two places: function calls and array literals. I think the implementation will be
- Proper tail calls
- Extensions to object literal syntax
- Classes
- Quasi-literals
- Pragmas
Updating SpiderMonkey extensions to Harmony
Direct proxies
There is a ton of verbiage here and it is still under active development.
- http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies
- http://wiki.ecmascript.org/doku.php?id=harmony:proxies_spec
- http://wiki.ecmascript.org/doku.php?id=harmony:proto_climbing_refactoring
- http://wiki.ecmascript.org/doku.php?id=harmony:virtual_object_api
Generators and comprehensions
- Certain scoping details in array comprehensions and generator expressions are probably different from what we have implemented.
function*
syntax - bug 666399- Allow returning a value from a generator - bug 666404
- There are probably one or two other minor details - details of StopIteration, that kind of thing.
let, const, and block functions
- Top-level let shouldn't be the same thing as var, per dherman: bug 589199
- TC39 is specifying that reading a let-variable before it is initialized is an error, which will be a separate bug.
const
- bug 611388- Block functions - bug 585536
- Destructuring
Mistakes (unnecessary breaking changes that can't be detected statically)
- Change how eval decides which value to return
- typeof null == "null" with Harmony opt-in - bug 651251