ES2017 Draft 2016-07-25

@bterlson bterlson released this Jul 13, 2016 · 68 commits to master since this release

New Features

  • String.prototype.padStart/padEnd
  • Object.values/Object.entries

Normative Changes

  • Unified handling of RegExp \w, \W, \b and \B. Notably, certain characters will no longer drop from \w when using the /ui flags (#525)
  • A proxy's OwnPropertyKeys no longer mistakenly throws an error when returning duplicate keys and the target object was non-extensible (#594)
  • Multiple function declarations in a block with the same name are now explicitly allowed by Annex B (#453)
  • TypedArray, ArrayBuffer, and DataView now have unified, consistent handling of index and offset parameters (#410)
  • When updating a descriptor and it is applicable, we will apply it always (rather than only when the values aren't SameValue). This fixes a case with NaN observability (#353)
  • Clarify that escape produces uppercase characters (#559)
  • Class extends null's default constructor now no longer attempts to call super (#543)
  • When creating a TypedArray from an existing TypedArray with a restricted view, only copy the necessary data rather than the entire buffer (#458)
  • TypedArray.from now allows lengths > 2^32-1 (#428)
  • An indirect export of a non-existent binding will now always fail (previously, a subsequent star-export might accidentally provide that name and be used instead). (#485)
  • global and sticky flags are read from [[OriginalFlags]] in RegExpBuiltinExec (instead of consulting the getters) (#494)
  • Allow various properties on RegExp.prototype to return undefined rather than throwing for web compat reasons (#262)
  • Clarify that Annex B extensions apply to Global code only when it is non-strict code (#460)
  • Added specification text for __defineGetter__, __defineSetter__, __lookupGetter__, and __lookupSetter for web compatibility reasons (#381)
  • Fixed missing [?Yield] parameter on PropertyName of AssignmentProperty (an ES6 oversight) (#388, #442)

Other Notable Changes

  • Hundreds of editorial fixes and changes.
  • Example productions (eg. in notational conventions section) no longer define the production making links work more reliably.
  • Modified Annex B productions now link to the modified definition rather than the global definition.
  • Many new cross-references added (notably, Assert)

Downloads

ES2016 Draft 2016-02-15

@bterlson bterlson released this Feb 12, 2016 · 301 commits to master since this release

Schedule Updates

ES2016 will be snapped and begin its journey toward an official ECMAScript standard on March 1st.

Normative Changes

  • Added the exponentiation operator.
  • Object.prototype is an immutable prototype exotic object. Its prototype cannot be changed in order to work around a security issue in the browser. See #308, #272.
  • The [[Enumerate]] MOP operation, Proxy's enumerate trap and Reflect.enumerate have been removed due to difficulties both in implementation and specification. See #367.
  • Unicode 8.0 is now required for ES2016. This implies slight changes at least to white space rules and case mappings. The committee intends to update this requirement regularly as Unicode releases yearly. See #300.
  • Proxy [[SetPrototypeOf]] trap now follows the precedent of other traps by not checking invariants of the target object when not needed. Specifically, when the proxy trap returns false, the extensibility of the target and the target's [[Prototype]] slot are not checked. See #331.
  • When using Array.from to consume an iterator, a TypeError is now be thrown when the length goes beyond the MAX_SAFE_INTEGER. See #352.
  • Clarified early error rules for proto. Specifically, early error rules do not apply when the ObjectLiteral appears in a context where ObjectAssignmentPattern is required and when initially parsing a CoverParenthesizedExpressionAndArrowParameterList. See #317.
  • Array.prototype.indexOf now normalizes -0 to +0 when -0 is passed as the start index and the search string occurs at index 0. See #316.
  • In SortCompare, string values are now compared using the Abstract Relational Comparison algorithm. See #315.
  • Extensive updates from @anba to Annex B Regular expressions to match Web Reality. See #303. Details:
    • Added InvalidBracedQuantifier to reject /{1}/ (previously allowed through ExtendedTerm -> Atom -> PatternCharacter)
    • Added ExtendedPatternCharacter to allow forms like /{*/, /}*/ /]/
    • ExtendedPatternCharacter also handles /\c%/ by removing the \ restriction (/\c%/ is equivalent to writing /\\c%/)
    • Added support for /[\c_]/ and /[\c1]/ to ClassEscape (the extended forms \c_ and \c<decimal digit> are only valid in Charact - Changed "ClassEscape :: [~U] DecimalEscape" to allow /[\8]/ by adding the restriction "but only if the integer value of DecimalEsc - Character ranges which start or end with a non-single element CharSet are now handled in a more web-conform way.
    • Merged Term and ExtendedTerm to avoid adding redundant semantics for ExtendedTerm
    • Re-ordered some production rules for clarity and to match 21.2.1

Other notable changes

  • The draft now auto-deploys when new commits are pushed.
  • Another few truckloads of editorial fixes and improvements.

Downloads

ES2016 Draft 2016-01-20

@bterlson bterlson released this Jan 20, 2016 · 359 commits to master since this release

Normative Changes

  • Fix a bug in the new TypedArray semantics that incorrectly specified that construction of subclasses of TypedArrays with an array parameter would call the subclass constructor again to convert the Array parameter to a TypedArray. The semantics are now what they were in ES6 in this case.

Editorial Updates

Too numerous to mention all of them. However, a new exciting change is that well-known intrinsic objects are now linked to their definitions!

Downloads

ES2016 Draft 2015-12-20

@bterlson bterlson released this Dec 20, 2015 · 384 commits to master since this release

Happy Holidays everyone in ECMAScript land! ๐ŸŽ ๐Ÿ”ฅ ๐Ÿ‘ช

Normative Changes

  • Significant refactoring to %TypedArray% and all of its subclasses. The previous specification required an observable walk of the prototype chain to construct instances. This is now removed by implementing the construct semantics directly in the subclass constructors and by making changes to methods that allocate typed arrays.
  • Extensive updates (mostly editorial) to the specification of the length property of built-in functions. The general case defined in clause 17 no longer includes optional arguments in the expected argument count thus aligning with how parameters with initializers. All subsequent length property specifications are removed when it duplicates the general case in clause 17. Explicit length specifications were added to clauses to preserve the previous semantics and web reality. In the case of a number of DataView.prototype APIs, there is no web consensus, and so these now follow the general case in clause 17.

Editorial Updates

This edition adds a new prefix operator, !, to the algorithm conventions for asserting that the result of an abstract operation does not result in an abrupt completion and that the completion record's [[value]] field should be unwrapped. This convention was applied to a number of calls to abstract operations but there are many remaining places that can use this new operator (pull requests welcome!).

Additionally, this edition moves more algorithms to the new ? operator for ReturnIfAbrupt. Also, many abstract operations that previously would pass through abrupt completions passed as parameters now do not exhibit this behavior. Instead, callers should use ? to prevent the call to the abstract operation in the first place.

Layering Changes

  • Added a ScriptRecord to parallel ModuleRecord. It contains information about the current script that is executing.
  • Every execution context can now find its containing ScriptRecord or ModuleRecord.
  • Added a ParseScript and ScriptEvaluation abstract operations (mostly factored out of ScriptEvaluationJob) that parallel similar operations for modules.
  • Added a new host hook HostReportErrors for reporting errors to the host.

Downloads

ES2016 Draft 2015-12-10

@bterlson bterlson released this Dec 10, 2015 · 396 commits to master since this release

Normative Changes

  • Add Array.prototype.includes and TypedArray.prototype.includes.
  • Relaxed ordering constraint in EnumerableOwnNames to allow implementation-defined ordering for objects that don't have ordinary objects' [[Enumerate]] slot (notably, proxies, for which the previous constraint was impossible to guarantee).
  • The order that arguments objects' caller and callee properties are created is reversed to reflect web reality. Namely, callee is now created before caller.

Layering Changes

  • Refactor ECMAScript Initialization into InitializeHostDefinedRealm. This leaves "implementation" creation up to hosts which gives them more flexibility (necessary for the browser).
  • Allow the global object and the value of this in global scope to be different by adding a [[GlobalThisValue]] slot to global environment records and allow hosts to set it as needed in NewGlobalEnvironment.

Bugzilla Bugs Fixed

1898 4467

Downloads

ES2016 Draft 2015-12-01

@bterlson bterlson released this Dec 1, 2015 · 426 commits to master since this release

Normative Changes

  • Promise.all and Promise.race no longer use @@ species to construct a new instance.
  • RegExp.prototype.[[@@ split]] now coerces limit using ToUint32. This was erroneously changed in ES6 to use ToLength which could result in broken array indexes.
  • Add new early error for functions which contain both a non-simple parameter list and a use strict directive (Notes: here and here).
  • BindingPattern is now allowed in BindingRestElement. Semantically this is not very useful, but it aligns the binding patterns with the assignment patterns. (Notes).
  • Remove [[Construct]] from generators. (Notes: here and here).
  • Allow CreateDynamicFunction to throw early reference errors (previously, it expected only syntax errors to be thrown).
  • Multiple fixes to Annex B declaration initialization semantics:
    • Tighten Annex B.3.5 catch parameter remedy to not allow redeclaration of bindings introduced via destructuring on the catch parameter.
    • Don't change GlobalDeclarationInitialization & EvalDeclarationInitialization declaredVarNames list because it is used to install the global var names (step 18).
    • Check GlobalDeclarationInitialization & EvalDeclarationInitialization declaredFunctionNames to avoid installing a global function binding multiple times.
    • Don't create a global function binding in EvalDeclarationInitialization if a global lexical binding is present.
    • Check for existing var-bindings in EvalDeclarationInitialization before calling CreateMutableBinding.
    • Set the deletable flag to true for CreateMutableBinding in EvalDeclarationInitialization.
  • Add new invariants for [[IsExtensible]] - it must return a Boolean, and once it returns false, all future calls must return false.
  • Add missing ToUint32 to ArrayAccumulation and Array Evaluation

Layering Updates

Layering updates do not contain any semantic changes but are instead useful for other specifications to use.

  • Add HostPromiseRejectionTracker which makes it easier for host applications (especially browsers) to provide promise debugging capabilities.

Bugzilla bugs fixed:

4510 4538 4474 4489
4477 4469

Downloads

ES2016 Draft 2015-11-03

@bterlson bterlson released this Nov 3, 2015 · 454 commits to master since this release

This release includes a very large number of editorial changes and markup fixes. The most notable include:

  • A new convention for calling ReturnIfAbrupt. Namely, the ? operator can precede a call to an abstract operation and indicates that ReturnIfAbrupt should be applied to the result.
  • Substantial normalization of the usage of ReturnIfAbrupt - many missing calls were added, and many superfluous ones were removed.
  • Many ECMASpeak syntax errors have been fixed.

This release also includes the following normative changes:

  • Add missing ToUint32 coercions to ArrayAccumulation nextIndex and Array Evaluation pad and len.
  • Add invariants for [[IsExtensible]], notably that it must return a Boolean and once it returns false it must always return false.
  • Add %TypedArray%.prototype.toLocaleString to the list of forbidden extensions in clause 16.1 as this is defined in ECMA-402.
  • proto is now allowed as an extension in strict mode code. This aligns the spec with implementation reality.
  • Add missing HasDirectSuper static semantics restrictions to GeneratorDeclaration.
  • RegExp.prototype[@@ split] will no longer attempt to access string elements beyond the string length.
  • Annex B.3.3 semantics now apply to non-top-level functions as well as top-level functions.
  • Date.parse now explicitly specifies that date-only forms without a UTC offset are interpreted as UTC. While not ideal semantics, it is nonetheless required for web compatibility (#138).
  • When removing the sloppy-mode arguments object mapping (due to, say, defining a property on the arguments object), the current value of the binding is assigned to the arguments object before the mapping is removed. This aligns the spec with implementation reality.
  • TypedArray's [[ByteOffset]] can no longer be -0. -0 is coerced to +0.
  • DataView's SetViewValue now coerces value to a number.
  • The length of the proxy revocation function is now 0 (previously unspecified).
  • Add missing PrepareForTailCall to Function.prototype.apply.
  • EvalDeclarationInstantiation now throws TypeErrors where ES5 threw TypeErrors. This also aligns the spec with implementation reality.
  • ModuleDeclarationInstantiation will now only initialize a var binding once even when multiple var bindings of the same name exist.
  • Fix missing completion reform for if and with. Specifically, if the result of evaluating these productions is an abrupt break completion, the completion type is changed to normal with a value of undefined.

Bugzilla bugs fixed: 4538 4489 4477 4469 4505 4504 4495 4494 4420 4471 4455 4434 4433 4427 4419 4371 4544 4536 4523 4521 4520 4519 4511 4506 4502 4501 4490 4488 4486 4485 4483 4480 4472 4462 4540 4541 4442 4466 4468 4478 4499 4509 4512 4513 4518 4543 4445 4460 4461 4475 4441 4444 4446 4447 4449 4450 4451 4452 4453 4454 4458 4459 4463 4464 4470 4473 4476 4479 4481 4491 4493 4517 4524 4527

Downloads

ES2016 Draft 2015-10-19

@bterlson bterlson released this Oct 19, 2015 · 515 commits to master since this release

  • Annex B semantics for GlobalDeclarationInitialization and EvalDeclarationInitialization. EvalDeclarationInitialization especially needs implementer scrutiny.
  • String.prototype.split has been reverted to ES5 semantics as per July 28 2015 TC39 meeting. The limit parameter is now coerced using ToUint32 instead of ToLength.
  • Number, Boolean, and String prototypes are reverted to ES5 semantics as per July 29 2015 TC39 Meeting. They are now instances of their type.

Many Bugzilla bugs were closed again. Please check Bugzilla bugs you care about since emails don't appear to be working.

Many markup and output improvements have been made. Notably, variables can now be clicked on to highlight all references to them. Additionally, the spec now offers a fuzzy search box that can be used to quickly navigate between clauses, abstract operations, and productions (use the "/" keyboard shortcut to focus search).

Downloads

ES2016 Draft 2015-10-05

@bterlson bterlson released this Oct 5, 2015 · 531 commits to master since this release

The changes in this draft don't introduce any new semantics. Numerous editorial issues have been fixed and some spec text has been clarified. Details below:

Additionally, over 100 Bugzilla bugs were closed as being already fixed or otherwise no longer valid against the latest version of the spec. If your bug was closed incorrectly as part of this effort, please re-open it on GitHub!

Downloads

ES2016 Draft 1

@bterlson bterlson released this Sep 22, 2015 · 574 commits to master since this release

ECMAScript moves to GitHub

This release marks the beginning of ECMAScript's journey toward version 2016. I am excited to announce that ECMAScript's development has moved to GitHub and ECMAScript's specification has moved from Word to Ecmarkupโ€”a custom dialect of HTML built for writing ECMAScript specifications. This change will make it much easier for the JavaScript community to contribute to its development.

The current specification is simply a conversion from the ES2015 Word document using some awesome tools. This process introduced a number of bugs. These will be worked out in future releases. Please help us by filing bugs for issues you find!

Going forward I will be releasing new drafts of ECMAScript using GitHub releases. Watch this repository to stay up to date!

Downloads