Skip to content

Instantly share code, notes, and snippets.

@azu
Last active August 31, 2016 15:34
Show Gist options
  • Save azu/3dc9295e97aee9a2706068caf65f0348 to your computer and use it in GitHub Desktop.
Save azu/3dc9295e97aee9a2706068caf65f0348 to your computer and use it in GitHub Desktop.
ECMAScript 2015 - 2016 diff points

ECMAScript 2015 - 2016 diff points

See also Normative commits: es2016-normative-changes.md

String.prototype.split has been reverted to ES5 semantics.

The limit parameter is now coerced using ToUint32 instead of ToLength.

  • ES5 (15.5.4.14.5): If limit is undefined, let lim = 2**32-1; else let lim = ToUint32(limit).
  • ES6 (21.1.3.17.8): If limit is undefined, let lim = 2**53-1; else let lim = ToLength(limit).

Notes: 6.12 String.prototype.split, its limit argument, and ToLength vs ToUint32 Commmits: Revert String.prototype.split's to ES5 behavior · tc39/ecma262@bfe9e11

Number, Boolean, and String prototypes are reverted to ES5 semantics

Number.prototype.valueOf(Number.prototype)

     <!-- es6num="19.3.3" -->
     <emu-clause id="sec-properties-of-the-boolean-prototype-object">
       <h1>Properties of the Boolean Prototype Object</h1>
-      <p>The Boolean prototype object is the intrinsic object %BooleanPrototype%. The Boolean prototype object is an ordinary object. It is not a Boolean instance and does not have a [[BooleanData]] internal slot.</p>
+      <p>The Boolean prototype object is the intrinsic object %BooleanPrototype%. The Boolean prototype object is an ordinary object. The Boolean prototype is itself a Boolean object; it has a [[BooleanData]] internal slot with the value *false*.</p>

early error of function tthat contain sloopy and strict.

Add Layer for Promise's unhandled rejection.

window.addEventListener('unhandledrejection', unhandled);
window.addEventListener('rejectionhandled', handled);

Remove [[Construct]] from generators.

Disallow new generatorFunction();

function * g() { this.foo }
new g(); // throw error

Add Array.prototype.includes and TypedArray.prototype.includes.

Why use includess instead of contains?

[[HostReportErrors]] and GetActiveScriptOrModule()

print("indexOf returns +0: " + (1/[true].indexOf(true, -0) > 0));
print("lastIndexOf returns +0: " + (1/[true].lastIndexOf(true, -0) > 0));

see also Improve TypedArray constructor/Proxy interaction by littledan · Pull Request #220 · tc39/ecma262

Remove Proxy enumerate trap and Reflect.enumerate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment