Draft Specification for ES.next (Ecma-262 Edition 6)

This page contains a historical record of working draft of the ES.next specification prepared by the project editor.

Errors in the current draft should be reported as bugs at bugs.ecmascript.org. Report the version you are reading, and an appropriate “component” (editorial issues, technical issues, etc.). Such bug reports are particularly useful for specific bugs such as misspellings or errors in algorithms.

An unofficial HTML version of the Edition 6 working draft is usually available at http://people.mozilla.org/~jorendorff/es6-draft.html]. Note that this HTML version may not always be up to date with the current working draft below.

Some Guidelines for Reading these Drafts

For now, all draft found here are snapshots taken of the project editor’s working draft. Snapshots are taken at fairly arbitrary points in time. The drafts are still far from being complete, often have incomplete treatment of new features, and sometimes are captured in the middle of some major refactoring. Many features that are intended for the next edition may not yet be included in any particular draft. Incomplete material and undecided issues are often marked with marginal notes within the document.

It is reasonable to assume that the editor is aware of the major inconsistencies or missing material, but you can’t over report. So if you see something that you think is important to capture, file a bug.

The rationale for design decisions, are not generally part of the specification. You can find background information on this wiki and in the archives of the es-discuss mailing list. If you want to discuss why certain decisions were made or want to argue for an alternative then you should post messages about specific issues to es-discuss.

The primary target audience of this specification is implementors who must create highly interoperable ECMAScript implementations. In one sense, the specification is all about the edge cases that implementors must get exactly right in order to be completely interoperable. Next comes the authors of interoperability and conformance test suites, such as test262. They need to write tests that help implementors conform to the specification. Third in priority, are sophisticated authors and educator. These are the people who will teach the language to the world, and like implementors, they need to know (or at least lookup) edge case behavior.

This is not intended as a document for everyday ECMAScript coders (although some will use it). It is also not a tutorial on either language design in general, language theory, or the design process behind its creation. The spec. also isn’t particularly targeted towards academics. We certainly want to have a sound language and where necessary TC39 members may prove characteristics of certain features. But such material is not necessarily included in the specification.

We generally within the specification try to minimize tutorial material (eg examples) and redundancy between normative prose descriptions and normative algorithms. Redundant descriptions has historically resulted in internal inconsistencies. We have also seen cases where implementors follow incomplete prose descriptions without referring to the more complete algorithm. For these reasons, much of the redundant prose from previous editions is being converted into non-normative notes. In general, examples are only used if they seem necessary to clarify some difficult to understand normative point. Sometimes an example is used in order to make it clear that some unusual design point is intentional and not a bug in the specification. The spec. generally does not discuss what a feature is good for or how to use it. Having said all that, the spec. doesn’t always follow these guidelines. We working on the 6th edition of a fifteen year old document and sometimes older material doesn’t follow newer conventions. Cleaning this up is mostly a “if time is available” task.

We generally don’t include non-normative rationale material. It would be great for somebody to create a document explaining all of the design rationales for the language. But I the editor doesn’t have the time to do both that and to also produce the actual specification. Rationale material can be mined from es-discuss threads, on wiki.ecmascript.org, and in TC39 minutes.

Final Draft

This is the final draft of ECME-262 6th Edition, The 2015 ECMAScript Language Specification. This draft has been submitted to the Ecma General Assembly members for their review and consideration. The GA will vote on approving it as a Ecma standard at their June 2015 meeting.

Assuming GA approval, it will still be possible to make very minor editorial corrections in the published version. So, please continue to report any bugs or typos at bugs.ecmascript.org

April 14, 2015 Rev 38 Final Draft

pdf, no change markup pdf with rev38 change markup
Changes marked as “Rev 38“. Change markup is relative to Release Candidate 4 (Rev37).

Changes include:

  • Tweaked completion value generation for iteration statements to enable loop unrolling.
  • Resolved bugs: 4279, 4274-4269, 4266-4258, 4256-4254, 4252-4248, 4133

Release Candidate Drafts

Development of the ECME-262 6h Edition, The 2015 ECMAScript Language Specification is complete. All that remains to find and fix and remaining editorial or technical bugs in the document.
Please report any bugs or typos at bugs.ecmascript.org

April 3, 2015 Rev 37 Release Candidate 4

doc, this is release candidate 4 with cumulative markup
pdf, no change markup pdf with rev37 change markup pdf with cumulative change markup
Changes marked as “Rev 37“. Change markup is cumulative starting with Release Candidate 1 (Rev34).

Changes include:

  • Various formatting tweaks and editorial and technical bug fixes.
  • Resolved bugs: 4247-4242, 4241-4240, 4238-4213, 4211-4202, 4200-4192, 4191-4185, 4183-4169, 4133

March 17, 2015 Rev 36 Release Candidate 3

doc, this is release candidate 3 with cumulative markup
pdf, no change markup pdf with rev36 change markup pdf with cumulative change markup
Changes marked as “Rev 36“. Change markup is cumulative starting with Release Candidate 1 (Rev34).

Changes include:

  • Several significant fixes relating to “completion reform”
  • Various formatting tweaks and minor editorial and technical bug fixes.
  • Resolved bugs: 4167-4166, 4163=4154, 4151=4148, 4145-4144, 4142, 4139-4125, 4123-4109, 4066, 3618, 3442, 1274, 522

March 4, 2015 Rev 35 Release Candidate 2

doc, this is release candidate 2 with rev35 change markup
pdf, no change markup pdf with rev35 change markup
Changes marked as “Rev 35“. Change markup is cumulative starting with Release Candidate 1 (Rev34).

Changes include:

  • Reverted back to no legacy RegExp.proptotype recognition in RegExp.prototype.exec and test
  • Eliminated buggy exotic [[Enumerate]] for String and Integer Indexed exotic objects. Tweaked ordinary [[Enumerate]] so it will work for them
  • Eliminate ambiguous optional tag on semicolon in do-while statement grammar. Added ASI rule to handle the case where that semicolon is missing.
  • Various formatting tweaks and minor editorial and technical bug fixes.
  • Resolved bugs: 4107-4104, 4101-4099, 4097-4096, 4094, 4091-4089, 4087-4084, 4082-4043, 4041-020, 4018-4013, 4000, 3993, 3989, 3979, 3965, 3865, 1223

February 20, 2015 Rev 34 Release Candidate 1

doc, this is release candidate 1 with with no change markup doc, this is release candidate 1 with cumulative markup
pdf, no change markup pdf with rev34 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 34“.

Changes include:

  • For legacy compatibility, Array.prototype goes back to being an Array exotic object (Array.isArray(Array.prototype) answers true).
  • For legacy compatibility, RegExp.prototype.exec.call/test.call act as if %RegExpPrototype% was still an RegExp instance
  • TypedArray slice, copyWith, set(TypedArray) do encoding preserving (memcopy) transfers when the source and target element types are the same.
  • The ‘next’ method of internally generated list iterator objects and the ‘revoke’ method of the object returned by Proxy.revocable are now non-enumerable, consistent with other built-in methods
  • Renamed Put() abstract operation to Set()
  • Eliminate the [lexical goal] grammar annotation. Instead clarified the explanation of lexical goals in clause 11
  • Eliminated Annexes D.2, D.3, E.2 that copying the ES5/51 Annex D/E into ES6. Too confusing because of section number mismatches. People should just look at Annex D/E of Es 5/5.1
  • Resolved bugs: 4012, 4010, 4005- 4002, 3999, 3995-3992, 3990-3985, 3983-3935, 3933- 3931, 3929-3902, 3900-3880, 3878-3861, 3859-3858, 3856-3846, 3791, 3759, 3753, 3751-3746, 3724, 3694, 3596, 3504, 3490, 3294, 3279, 3138-3137, 3114, 3074, 2916, 2401, 2215, 1801, 1782, 1778, 1770, 1522-1521, 1075, 1059, 635, 172, 116

Previous Drafts

February 12, 2015 Draft Rev 33

doc with accuu
pdf, no change markup pdf with rev33 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 33“.

Changes include:

  • Refactoring of module abstract operations to support module loader specifications
  • Additional runtime declaration error checks for non-strict evals (bugs 3410, 3383, 2853)
  • Added early error for super() in non-derived class constructors
  • Added an early error for super property accesses in function/generator declarations/expressions
  • Tweaks to for-in/of grammar to resolve shift/reduce conflict and eliminated an unnecessary look-ahead restriction
  • new and super() expressions can’t be tail calls because they have post return processing
  • Array destructuring stops calling next on its iterator once done state is reached. Only calls return method if iterator isn’t exhausted
  • Function bind now propagates the target function’s [[Prototype]] rather than setting the [[Prototype]] of all bound functions to Function.prototype
  • Resolved bugs: 3844-3843, 3841-3818, 3816-3813, 3811-3810, 3808, 3806-3805, 3793, 3791, 3788-3784, 3782-3760, 3758-3754, 3752, 3745-3738, 3736-3726, 3693, 3687, 3684-3683, 3619, 3607, 3595, 3577, 3575, 3518, 3503, 3410, 3383, 2853, 2768, 2606, 2437, 1601

February 2, 2015 Draft Rev 32

pdf, no change markup pdf with rev32 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 32“.

This revision contains the last of the planned design changes for ES6. From this point forward all changes should be bug fixes.

There are some known cross-reference anomalies in this revision. Those will be corrected in the next revision.

Changes include:

  • Removed ‘new super()’ syntax
  • new.target meta-property no longer highlighted as tentative.
  • Methods defined within class definitions are now non-enumerable
  • Classes defined as class extends null {...} are now consider to be derived classes
  • Constructors defined using class definition syntax throw when called as functions
  • Function.prototype.toMethod has gone away. Only class declarations and object literals can set a functions [[HomeObject]]
  • Object.prototype.toSring no longer censors use of legacy [[class]] values.
  • Empty object destructuring patterns without default values (eg, { }) throw if the value assigned to them is null or undefined. This make { } more consistent with the behavior of [ ]
  • Array destructoring performs an InteratorClose upon iterators it creates.
  • Fixed handling of throw and close methods received by a yield* (see bug https://bugs.ecmascript.org/show_bug.cgi?id=3526 ) (further refinements may still be coming).
  • IteratorClose no longer cares whether the object returned from the ‘return’ method has done:true.
  • Resolved bugs: 3723, 3721-3695, 3691-3688, 3686-3685, 3682-3680, 3678-3627, 3625-620, 3617-3608, 3606-3597, 3594-3581, 3579-3576, 3574, 3571-3563, 3561, 3558-3545, 3526, 3519, 3431, 3220, 3206

January 15, 2015 Draft Rev 31

pdf, no change markup pdf with rev31 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 31“.

Changes include: Updated specification to use and support the new built-in subclassing scheme described at: https://github.com/tc39/ecma262/blob/master/workingdocs/ES6-super-construct%3Dproposal.md

  • Added newTarget parameter to [[Construct]], Reflect.construct, and proxy ‘construct’ trap.
  • Added NewTarget binding to Function Environment Records and abstract operations/methods of setting and accessing that binding
  • Redefined [[Construct]] for ordinary ECMAScript functions so “derived” constructors don’t preallocate the new object and bind this.
  • Changed [[Construct]] for ordinary ECMAScript functions so “derived” constructors will throw if they try to explicitly return a non-object.
  • Within constructors this binding has TDZ access semantics.
  • super(...) syntactic form now illegal in Function/GeneratorDeclaration/Expression
  • super(...) and new super(...) propagates current NewTarget to [[Construct]] call
  • super(...) binds this value upon return from [[Construct]] call, throw if new already bound
  • Refactored [[Call]] and [[Construct]] for ordinary ECMAScript functions so they can continue to shared common spec steps.
  • Updated Generator object instantiation to work with new [[Construct]] design
  • Refactored Function constructor and GeneratorFunction to share a common abstract operation based definition
  • Every built-in constructor changed to merge object allocation and initialization code. In some cases (eg, TypedArray and Promise) significant refactoring of allocation and initialization logic.
  • Updated [[Construct]] of Bound functions to handle newTarget parameter.
  • Several of the above items are tentative because they still lack full TC39 discussion and review. The following are particularly tentative:
    • restrictions on where super(...) is allowed may change
    • new super(...) might go away or change
    • Support for the new.target access syntax (yellow highlight in spec text) is speculative and may move to ES7 and/or change

Other changes

  • Merged AllocArrayBuffer and SetArrayBufferData into single abstract operation
  • %TypedArray%.of now requires that its this value is a valid Typed Array constructor
  • Replaced “moduleId” with “sourceCodeId” and eliminated most usage of such ids in module related abstract operations
  • Some tweaking of Language Overview in 4.2
  • A new document title
  • Resolved bugs: 3543-3527, 3524-3523, 3520, 3517-3516, 3514-3511, 3501-3496, 3494-3479, 3310, 3229, 3136, 2865, 2536, 2495, 2179

December 24, 2014 Draft Rev 30

pdf, no change markup pdf with rev30 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 30“.

Changes include:

  • Made it a runtime error to try to create a subclass of a generator function via a class declaration or class expression.
  • Correct bugs in String.prototype.match/replace/search/split in the logic for double dispatching to a RegExp agument
  • Added language in 8.4 making it explicit that ES Jobs always run to completion
  • Class name is in TDZ during extends clause evaluation
  • Added static semantics that correctly validates statement label usage.
  • Array.prototype.concat/push/splice throw TypeError if new length would be 2^53 or greater. (Bug 3409)
  • Defined the Annex B (B.1.3) lexical grammar extensions for recognizing legacy HTML-like comments
  • Added a forbidden extension item that forbids supporting HTML-line comments within modules.
  • Additional early error for super() in non-constructor methods. (Already had an error for new super()).
  • Object.prototype.toString now uses IsArray to when testing for built-in exotic array instances.
  • IsArray abstract operation now longer throws if argument is a revoked proxy. It just returns false.
  • Simplified and corrected early error naming rules for module exports
  • Fixed several left-to-right evaluation order initialization bugs in various declaration forms
  • Resolved bugs: 3476-3445, 3443, 3441-3434, 3430-428, 3425-418, 3416-3411, 3409-3407, 3405-3404, 3396, 3306, 3284, 3269, 3264, 3230, 3214-3213, 2911, 2838, 2610, 2437, 1467, 1204, 935, 708, 631, 512, 509, 499, 170, 159

December 6, 2014 Draft Rev 29

pdf, no change markup pdf with rev29 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 29“.

Changes include:

  • Support for normalizing relative module name
  • RexExp constructor no longer throws when the first argument is a RegExp and the second argument is present. Instead it creates a new RegExp using the same patterns as the first arguments and the flags supplied by the second argument.
  • Added ‘flags’ method to RegExp.prototype that returns a string containing the flag characters. This enables generic RegExp algorithms to pass through new flags added by RegExp subclasses.
  • Updated RegExp.prototype.split to work with RegExp subclass that over-ride exec to change the default matching algorithm.
  • Eliminated WeakMap/WeakSet clear methods
  • String.prototype.includes replaces String.prototype.contains
  • Symbols @@match, @@replace, @@search, @@split, replace the corresponding string property names in RegExp prototype
  • Eliminate @@isRegExp and Symbol.isRegExp
  • Some cleanup of RegExp constructor to better support RegExp subclassing
  • The this binding at the top level of a module has the value undefined.
  • @@species defined on RegExp, Array, %TypedArray%, Map, Set, ArrayBuffer, Promise
  • @@species pattern used to create derived instances of RegExp, Array, %TypeArray%, ArrayBuffer, and Promise, eliminates Zepto breakage
  • Within the spec, « » now used to bracket literal List values
  • Eliminated deferred throw of first exception from Object.assign, Object.create, Object.defineProperties, Object.freeze, Object.seal, Object.isFrozen, Object.isSealed
  • Template call sites objects are now canonicalized per realm, based upon their list of raw strings.
  • Assigning to a const declared binding throw, even in non-strict mode code.
  • Eliminated requirement to statically find and report assign to const declared names.
  • Made it a runtime error for a global let/const/class declaration to shadow a non-configurable property of global object.
  • Eliminated unnecessary and observable (via strict get accessor) boxing before/in calls to GetIterator. This also makes ToObject unnecessary on RHS of destructuring assignment/binding
  • Eliminate ToObject application to target argument of Reflect functions. Passing primitive values as targets now throw
  • export default ClassDeclaration is now legal, includes allowing anonymous class declarations as default export
  • Resolved bugs: 3403-3402, 3397, 3394-3393, 3390-3387, 3384, 3382-3371, 3369-3311, 3309-3308, 3305, 3301-3300, 3298, 3296-3295, 3293, 3289-3287, 3285, 3282-3281, 3267, 3261, 3257-3256, 3253, 3237, 3151, 3148, 3063, 3006, 2662, 2585, 2368, 1232, 522

October 14, 2014 Draft Rev 28

pdf, no change markup pdf with rev28 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 28“.

Changes include:

  • Removed loader pipeline and Reflect.Loader API (functionality being transferred to separate specification)
  • Stream-lined module linking semantics for declarative modules.
  • Added Module request task
  • Removed Module declaration
  • Update Import declaration to include module imports.
  • Updated default export syntax and semantics to support export of anonymous default functions
  • Added Module Environment Records and indirect (import) bindings
  • Added Module evaluation jobs
  • Added Host hooks for module name normalization and source access.
  • Finished up ES6 eval function semantics
  • Eliminated unused abstract operations, PromiseAll, PromiseCatch, PromiseThen
  • Modified Promise.all so specification internally uses a List instead of an Array to accumulate result promises
  • Added @@iterator property to %IteratorPrototype%
  • Added requirement that the object returned by ordinary object [[Enumerate]] must inherit from %IteratorPrototype%
  • Removed own @@iterator properties from various standard iterators, they now inherit it from %IteratorPrototype%
  • Updated ToPropertyKey to accept Symbol wrapper objects, similar to how other primitive coercion abstract operations handle wrapper objects
  • ToNumber now recognizes binary and octal string numeric values.
  • Significant fix to destructuring assignment where the rest assignment target is itself a destructuring pattern
  • Changed ordinary object creation to dispatch object allocation through [[CreateAction]] internal slot instead of @@create method.
  • Converted all @@create methods into CreateAction abstract operations.
  • Eliminated Symbol.create and @@create.
  • super without an immediately following property specifier is now illegal in all MethodDefinition (no more implicit super using current method name)
  • super in a constructor call expression references the constructor’s [[Prototype]]
  • Function.prototype.toMethod no longer takes an optional name argument
  • Updated Annex A Grammars to match ES6
  • Resolved bugs: 3278-3273, 3271-3270, 3268, 3266, 3263-3262, 3260-3258, 3255-3254, 3252, 3247, 3245, 3243-3238, 3236-3231, 3228-3224, 3222-3221, 3218, 3216-3215, 3211-3207, 3204-3162, 3159-3151, 3149, 3144, 3132, 3130-3129, 3123, 3119, 3106, 3104, 3094, 3013, 2999, 2996, 2972, 2947, 2852, 2834, 2820-2819, 2812, 2792, 2726, 2684, 2683, 2524, 2341, 2302, 2039, 1788, 1608, 1595, 1111, 949, 921, 502, 164, 151

August 24, 2014 Draft Rev 27

pdf, no change markup pdf with rev27 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 27“.

Changes include:

  • Fixed scoping bug in for-of, catch clause, comprehensions WRT TDZ for iteration bindings. see bug: https://bugs.ecmascript.org/show_bug.cgi?id=3011
  • For-in/for-of loop bodies can’t contain tail calls because of need to close the iterator on abrupt completion.
  • [[OwnPropertyKeys]] now returns a List rather than an Array
  • Tests of @@isRegExp are now based on ToBoolean(Get(obj, @@isRegExp)
  • Array find/findIndex no longer ignore array element holes.
  • Added %IteratorPrototype% that all built-in iterators inherit from.
  • Destructoring now performs ToObject on values to be destructured.
  • Array and generator comprehensions removed from language
  • Removed specification of Reflect.Realm
  • Object.assign ignores null and undefined source arguments
  • Added 16.1 that lists forbidden extensions.
  • Some editorial cleanup of Function.prototype.toString
  • Removed all explicit poison pill methods on functions (except for Function.prototype) and added 16.1 restrictions on such extensions.
  • String(aSymbol) now returns the symbol’s description. Does not change ToString(symbol) throwing ever where else.
  • aSymbol == Object(aSymbol) now is true, just like other wrapable primitives, see bug: https://bugs.ecmascript.org/show_bug.cgi?id=3066
  • Tighten specification of when Array.prototype.sort is implementation defined
  • Revised @@unscopable semantics as per last TC39 meeting
  • Made it an error to reentrantly enter a generator via next/throw/return.
  • Further work on semantics of Generator return method in the context of yield*
  • The term “neutered” has been replaced with the term “detached”
  • Resolved bugs: 3147, 3142-3140, 3135-3133, 3131, 3128-3124, 3122-3120, 3117, 3115, 3111-3107, 3105, 3103-3098, 3096-3095, 3093-3092, 3090-3089, 3087-3082, 3080-3062, 3060-3016, 3012-3011, 3005, 2987, 2979, 2976, 2831, 2389, 2368, 1908, 523, 516, 513, 407, 91

July 18, 2014 Draft Rev 26

pdf, no change markup pdf with rev26 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 26“.

Changes include:

  • Terminology change: “Task” is replaced by “Job”.
  • GetMethod now treats null and undefined equivalently as meaning no method available.
  • Eliminated the ability of Proxy handlers to extend the set of property descriptor attributes they expose vis [[GetOwnProperty]]
  • Added invariant checks for Proxy [[OwnPropertyNames]] internal method
  • Revisited @@unscopable support in Object Environment Records
  • Updated Annex C (strict mode summary) WRT ES 6 changes and extensions.
  • Eliminated duplicate property name restrictions on object literals and class definitions
  • For-of now throws if iterable value is null or undefined (also reverted comprehensions to throwing for that case)
  • Date.prototype.toString now uses NaN as its time value when applied to an object with out a [[DateValue]]
  • Function poision-pill caller and arguments properties are now configurable
  • await is a FutureReservedWord when parsing and Module is the syntactic grammar goal symbol
  • Better integration of O.p.toLocaleString and String.p.toLocaleString with Ecma-402
  • Annex B support for function declarations in IfStatmentClauses
  • Annex B (and 13.12) support for legacy labelled FunctionDeclarations.
  • Another round of updates to 9.2.13 FunctionDeclarationInstanations to fix various scoping bugs.
  • Updated Symbol conversions: aSym == “not a symbol” produces false. var s=Symbol(); s==Object(s) produces true. foo”+aSymbol or aSymbol+”foo” throws TypeError. Symbol @@toPrimitive returns the wrappered symbol value. ToNumber(aSymbol) throws.
  • Spread now works on strings: var codeUnits = [...”this is a string”];
  • yield * now works with strings: function * getchars(str) {yield * str}
  • Added name property for bound functions in F.p.bind. Fixed bugs in generating length property in F.p.bind
  • Tweaked Script GlobalDeclarationInstantiations to deal with error situations that could arise from misusing proxies for the global object.
  • Added an informative generator function based definition for ordinary object [[Enumerate]]
  • Changed handling of NaN returned from a sort comparefn to match web reality. See bug https://bugs.ecmascript.org/show_bug.cgi?id=2978
  • Generator object return method/For-of/in loops use return method on generators
  • Resolved bugs: 3010, 3004-3000, 2992, 2990-2988, 2984-2983, 2981-2980, 2978-2977, 2975, 2971-2948, 2946-2937, 2935-2922, 2919, 2917, 2915, 2910-2891, 2888-2884, 2880, 2875, 2840, 2828, 2813, 2811, 2803, 2799, 2778-2777, 2721-2720, 2718-2717, 2682, 2636, 2634, 2594-2592, 2590-2589, 2587, 2564, 2488, 2411, 2365, 2360, 2324, 2315, 2080, 2053, 2049, 1797, 1789, 1762, 1459, 1444-1443, 1341, 1267-1266, 1142, 977, 944, 522, 519

May 22, 2014 Draft Rev 25

pdf, no change markup pdf with rev25 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 25“.

Changes include:

  • Added Content of 8.5 Initialization (of the ES execution environment)
  • Additional cleanup/refactoring of Realm initialization
  • Changed Object.prototype.toString default result for Proxy objects
  • Made toMethod work for bound functions
  • Made comprehensions do 0 iterations if value of for-of expression is undefined or null to be consistent with for-in/of statements.
  • Strengthened restrictions on use of ‘yield’ in arrow function parameters. See bug 2732.
  • %TypedArray%.prototype.byteLength/byteOffset/length now return 0 instead of throwing if the underlying ArrayBuffer has been neutered.
  • Added host defined data to PendingTask records and host hooks into Enqueuing and dispatching Tasks.
  • Legacy octal escape sequences (Annex B.1.2) are not allowed within template string literals.
  • Resolving thenables runs in a separate Task
  • Resolved bugs: 2882-2881, 2878-2877, 2874-2870, 2867-2866, 2864-2859, 2857-2854, 2851-2839, 2837, 2835, 2833-2832, 2830-2829, 2826-2821, 2817-2813, 2810-2804, 2802, 2801-2797, 2793, 2790-2779, 2776-2769, 2767-2756, 2753-2735, 2733-2731, 2725, 2706-2695, 2692, 2689-2688, 2686, 2675, 2671, 2656-2655, 2604, 2596-2595, 2574, 2545-2538, 2535-2532, 2530-2528, 2523, 2520, 2505, 2502, 2499, 2497, 2485, 2480, 2468, 2466, 2464-2462, 2460, 2459, 2455-2454, 2451-2450, 2448-2446, 2444, 2438, 2434-2428, 2426, 2422, 2402, 2399, 2394, 2392-2391, 2387, 2369, 2365-2364, 2358-2355, 2351, 2349, 2346, 2344, 2336, 2334, 2330, 2327, 2321-2318, 2316, 2313-2307, 2304, 2294-2293, 2288, 2276, 2265, 2263, 2224, 2223, 2219-2216, 2214, 2210, 2132, 2114, 1929, 1353, 811

April 27, 2014 Draft Rev 24

pdf, no change markup pdf with rev24 change markup pdf with cumulative change markup since rev22
Changes marked as “Rev 24“.

Changes include:

  • Several important bug fixes to Function Declaration Instantiation
  • Updated RegExp so that subclasses that over-ride exec semantics don’t have to also over-ride match/replace/search
  • disallowed a line break between ArrowParameters and the ⇒
  • Adjust Array.prototype.reverse and Array.prototype.unshift to eliminate several unnecessary MOP calls that were exposed if the array is a proxy
  • Object.assign now accepts multiple source arguments
  • arguments object now have an @@iterator own property
  • %TypedArray% constructors now processes iterables as an argument.
  • Changed length property value of Symbol, Map, Set, WeakSet, WeakMap to 1 to be consistent with most other built-in constructors
  • Added Annex B item about var declarations in catch clauses that binding the same name as a catch parameter
  • Array.from/typedArray.from now calls filter function with two arguments.
  • Eliminated static semantic rules that made the following an early error function({x}){var x} or generator(x) {var x}. A var declaration now can always be the same name as a formal parameter
  • Made for (let x in x), etc. a TDZ violation
  • further tweaking of super related productions in MemberExpression and NewExpression
  • Bug fix in GetBindingValue to make TDZ work. Accessing an uninitialized binding always throws and is not conditional on strict mode.
  • Started update of Annex A. Lexical grammar updated
  • Resolved bugs: 2729, 2727, 2724-2722, 2714-2713, 2711-2706, 2695-2688, 2685, 2681-2660, 2658-2657, 2655-2654, 2652-2649, 2647-2640, 2638-2637, 2635-2613, 2611, 2608-2607, 2605-2604, 2600, 2573, 2566, 2561, 2558-2557, 2551, 2548-2547, 2537, 2528-2526, 2477, 2445, 2443, 2337, 2314, 2154, 2010, 1540, 1114

April 5, 2014 Draft Rev 23

doc, no change markup doc, rev23 change markup
pdf, no change markup pdf with editor's margin notes pdf with rev23 change markup
Changes marked as “Rev 23“. Change markup is relative to Rev 22, January 20, 2014. Not that the markup versions have some algorithm step numbering anomalies that don’t actually exist in the absence of the markup. If you see one, double check it without markup.

Changes include:

  • Math.clz32 replaces Number.prototype.clz
  • for (let;;) loops get a new scope per iteration
  • Added [Yield] grammar parameter to ArrowFunction (Bug 2504)
  • Added [Yield] grammar parameters for Function/Generator/Class Declarations
  • Added [GeneratorParameter]] parameter to ClassExpression
  • Clarified that certainly early errors don’t apply when processing parenthesized expression cover grammar bug 2506)
  • 11.1.2 clarified the distinction between ES whitespace and Unicode whitespace. Added note that some Unicode white space characters are intentionally no ES whitespace
  • Fixed Symbol.prototype.toString Symbol.prototype.valueOf to work correctly when this value is a primitive string value
  • Lookahead let restrictions added: IterationStatement: for (LeftHandSideExpression of AssignmentExpression)... and for (LeftHandSideExpression in Expression)...
  • Lookahead grammar restriction to disambiguate: new super()
  • Reverted default for missing class constructor back to “constructor(...args) {super(...args)} because of bug 2491
  • Refactored identifier syntax/semantics into IdentiferReference, BindingIdentifier, and LabelIdentifier motivated by need to allow unicode escapes in non-keyword yield identifiers
  • Tweaked ordinary call to allocate non-strict mode wrapper objects using callee’s Realm
  • Named %Loader%: Reflect.Loader
  • Named %Realm%: Reflect.Realm
  • Added Reflect.Loader.prototype.@@toStringTag property
  • Provide complete algorithmic definition for RegExp.prototype.replace and RegExp.prototype.search
  • corrected RegExpExec so it correctly translates the match state of full Unicode RegExps back to UTF-16 capture values and endIndex.
  • documented (Annex D) fix to ES5 bug that exposed array updates to integer conversions side-effects
  • Typed Array Indexing: All canonical string numeric values considered to be possible indexes rather than expando property keys, eliminated vestigial spec. language for readonly/frozen typed arrays.
  • Updated Annex B function in block legacy compatibly hack based upon Jan. meeting concensus
  • Updated Function.prototype.toMethod as per Jan. meeting.
  • Updated Promises as per Jan. meeting consensus
  • Switched to “ize” from secondary British “ise” spelling of “initialize” and other words.
  • Resolved bugs: 2598-2597, 2591, 2584-2583, 2581-2578, 2576, 2572-2567, 2563-2562, 2560-2559, 2555, 2552, 2549, 2546, 2525, 2522-2521, 2519-2517, 2515-2514, 2512-2506, 2504, 2501-2500, 2498, 2493-2491, 2489, 2486, 2484, 2482, 2479-2478, 2476-2473, 2471-2469, 2465, 2442-2439, 2435, 2427, 2424-2423, 2419-2417, 2415-2413, 2410-2407, 2404-2403, 2398-2395, 2393, 2390, 2370, 2368-2367, 2363-2359, 2352, 2350, 2347, 2343-2342, 2338, 2335, 2331, 2329-2328, 2326-2325, 2322, 2295, 2266, 2256, 2239, 2209, 1910, 1790, 1734, 1483, 1475, 1413-1412, 1263, 1240, 1158, 913, 311, 222

January 20, 2014 Draft Rev 22

doc pdf with change markup only for this revision pdf without markup
Changes marked as “Rev 22“. Change markup is relative to Rev 21, November 8, 2013

NOTE There are some formatting irregularities (extra line spacing, wrong left margin) for a number of the algorithms. These will be correct in future revisions.

Changes include:

  • Promises
  • Module loading/linking semantics
  • Internal Tasks
  • Realm Objects
  • Loader Objects
  • updated with binding for unscopable names as discussed at Sept 2013 meeting
  • An unscopables object is now an ordinary object whose own property keys are the unscopable names.
  • Fixed sticky mode bugs in RegExpExec
  • Provided algorithm for RegExp.prototype.replace and updated other RegExp methods
  • Fixed RegExp matcher algoritm to normalize results of Unicode mode matches back to UTF-16
  • Grammar parameter tweaks related to use of yield in generator parameters.
  • Simplified eval/arguments restrictions. They never are applied in non-strict code
  • Added tail call detection for arrow functions with expression bodies
  • clarified unicode escaping in IdentifierNames and keywords
  • The default class constructor definition is now “constructor(...args) {return super (...args);)” if one is not explicitly provided (adding explicit “return” is the change)
  • Fixed Invoke abstract operation to correctly handle invokes on primitive values. Implementations of built-ins that are * specified using Invoke should make sure they work correctly in cases where Invoke might be validly applied to a primitive
  • Function.prototype.toMethod, replaces RebindSuper abstraction operation with CloneMethod
  • Eliminated comparator optional argument to Map and Set constructor
  • Removed vague overflow/underflow requirements from Math.Hypoth
  • Creating a Proxy requires use of new.
  • No line terminator allow before the * in yield *.
  • extends clause of a class declaration is now a LeftHandSideExpression
  • Completely redo of object invariants section.
  • Fixed bugs include: 2306-2303, 2301-2298, 2296, 2294-2288, 2286, 2284-2267, 2265-2257, 2255-2240, 2238-2234, 2232-2218, 2216-2214, 2211-2210, 2046, 1908

November 8, 2013 Draft Rev 21

doc pdf with change markup only for this revision pdf without markup
Changes marked as “Rev 21“. Cumulative change markup is relative to Rev 20, October 28, 2013

NOTE No cumulative markup is available for this revision. It was lost in the course of fixing some major formatting problems that were present in Rev20.

Changes include:

  • Updated Module Syntax and static semantics
  • Scripts no longer may contain import statements
  • Specified how to determine if a call is in tail position
  • The call and apply functions now internally do tail calls to the target function
  • Tweaked the new operator so it will work in tail position
  • Eliminated the [[Invoke]] MOP operation
  • Calling the next method of an completed generator returns a “done” result instead of throwing
  • The length property of bound functions is now configurable/non-writable
  • Clarified requirements of String localeCompare when no language sensitive comparison support is available.
  • Tweaked the ordering of a few steps in Array.from to enable self-hosting using for-of
  • Added ToInt8 and similar abstract operation
  • Defined name property of %TypedArray% and the individual typed array constructors
  • Significant fixed to yield * evaluation semantics
  • Fixed handling of identifier ‘yield’ in generator function parameter lists
  • A little static semantic cleanup making sure that FunctionDeclarations and GeneratorDeclarations have the same top level scoping rules
  • Fixed bugs include: 2208, 2206-2180, 2178-2156, 2153-2139, 2137-2134, 2130-2115, 2113-2082, 2045, 1956, 1868, 1859, 1851, 1841, 1823, 1633, 1295, 1273, 968, 959, 871, 814, 738

October 28, 2013 Draft Rev 20

doc pdf with change markup only for this revisionpdf with cumulative change markup pdf without markup
Changes marked as “Rev 20“. Cumulative change markup is relative to Rev 17, August 23, 2013

Changes include:

  • Introduced grammar parameters and eliminated NoIn productions
  • Spread now requires an Iterable rather than an array-like
  • B.1.4, Web browser extensions to RegExp Pattern grammar and semantics
  • Updated RegExp to actually do sticky matching.
  • Updated RegExp to support “u” (unicode) patterns and matching.
  • Defined String @@iterator and String Iterator objects bug fixes in Object.mixin
  • Added support for revokable proxies
  • Added Proxy and Proxy.revokable factory functions
  • Removed the JSON grammar and replaced it with references to Ecma-404
  • Added requirement that Math.random functions in different code realms must produce difference sequences of numbers
  • Made Map, and Set built-in iterators so that once they return a result of completed they always return complete on subsequent calls to next.
  • Added Symbol.prototype[@@toPrimitive]
  • Added name property for functions created via function/generator/class declarations or binding initializers and assignment.
  • Defined the name property conventions for built-in functions.
  • Added normative reference to Ecma-404, removed normative reference to C standard.
  • Added normative reference to Ecma-402 and made Ecma-402 support a conformance requirement for ES implementation that provide an internationalization API.
  • Updated toLocale*String methods with reference Ecma-402
  • [[Construct]] for Proxy objects throw if no “construct” trap and target does not have a [[Construct]]
  • Changed terminology “ordinary function object” to “ECMAScript function object”
  • fixed ArrayBuffer(len) and %ArrayBuffer%(len) to throw RangeError on infinite length
  • make sure yield is usable as a statement label in non-strict code, except in generator functions.
  • consolidated in BindingIdentifier static semantic restrictions on strict mode declarations of eval and arguments
  • changed the way strict mode use of strict mode only reserved words are specified.
  • use parameterized grammar productions to restrict where return statements can appear
  • added grammar restrictions preventing an ExpressionStatement from stating as “let [”
  • terminology: “internal data property” is now “internal slot”
  • changed handling of non-object values in WeakMap as per bug 1938
  • Renamed abstract operation CreateOwnDataProperty to CreateDataProperty. Added CreateDataPropertyOrThrow abstract operation
  • Elaborated in 9.3 that built-in functions can be implemented as either ECMAScript functions or as implementation defined exotic functions.
  • Eliminated [[GlobalArray]] compatibility hack in slice and certain Array methods, replaced with a Realm check
  • fixed bugs: 2077-2072, 2069, 2067-2054, 2052-2050, 2048-2046, 2043, 2041-2040, 2037-2035, 2033, 2032, 2030-2028, 2026-2012, 2010-1941, 1938, 1909, 1903, 1900, 1870, 1869, 1863, 1858, 1855, 1854, 1852, 1804, 1660, 1619, 1574, 1358, 1287, 1274, 1268, 1250, 1226, 1116, 1113, 972, 872, 791, 749, 740, 625, 594, 528, 526-524, 519, 498, 481, 428, 407, 364, 230, 206, 119

Early Drafts

harmony/specification_drafts.txt · Last modified: 2015/04/17 15:53 by allen
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki