Skip to content

ES2016 Draft 2015-12-20

Pre-release
Pre-release
Compare
Choose a tag to compare
@bterlson bterlson released this 20 Dec 23:15

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.