From 030db8b688e8a151e8991e60abf929d3be93f3ef Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 17 Jan 2019 06:38:32 +0530 Subject: [PATCH 01/14] example for bigint --- _data/stage3.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/_data/stage3.yml b/_data/stage3.yml index 66c5c8f2..ba5dc980 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -67,6 +67,14 @@ - Daniel Ehrenberg tests: - https://github.com/tc39/test262/issues/1056 + example: > + const theBiggestInt = 9007199254740991n; + + const alsoHuge = BigInt(9007199254740991); + // ↪ 9007199254740991n + + const hugeButString = BigInt('9007199254740991'); + // ↪ 9007199254740991n resources: - https://github.com/tc39/proposal-bigint From bfe4c8f3ad1b379e5abcebe4d4751010eebd1008 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 17 Jan 2019 06:39:18 +0530 Subject: [PATCH 02/14] example for Function.prototype.toString revision --- _data/stage3.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_data/stage3.yml b/_data/stage3.yml index ba5dc980..e4d6a6a6 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -7,6 +7,13 @@ tests: - https://github.com/tc39/test262/issues/1163 specification: https://tc39.github.io/Function-prototype-toString-revision/ + example: > + // String's parse must contains the same + // function body and parameter list as the original. + + O.gOPD({ get a(){} }, "a").get // "function a(){}" + + O.gOPD({ set a(b){} }, "a").set // "function a(b){}" resources: - https://github.com/tc39/Function-prototype-toString-revision From 11fe2a8b3cf76e215d4a650619d266d7aff8406b Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 17 Jan 2019 06:48:11 +0530 Subject: [PATCH 03/14] example for Private instance methods and accessors. --- _data/stage3.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/_data/stage3.yml b/_data/stage3.yml index e4d6a6a6..9b0295a6 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -106,6 +106,32 @@ - Kevin Gibbons tests: - https://github.com/tc39/test262/issues/1343 + example: > + class Counter extends HTMLElement { + #xValue = 0; + + get #x() { return #xValue; } + set #x(value) { + this.#xValue = value; + window.requestAnimationFrame(this.#render.bind(this)); + } + + #clicked() { + this.#x++; + } + + constructor() { + super(); + this.onclick = this.#clicked.bind(this); + } + + connectedCallback() { this.#render(); } + + #render() { + this.textContent = this.#x.toString(); + } + } + window.customElements.define('num-counter', Counter); resources: - https://github.com/tc39/proposal-private-methods From 4b5614f0e182ec7a0126940884761096a9012dfd Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 17 Jan 2019 07:06:04 +0530 Subject: [PATCH 04/14] example for Array.prototype.{flat,flatMap}. --- _data/stage3.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_data/stage3.yml b/_data/stage3.yml index 9b0295a6..df585c0d 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -143,6 +143,10 @@ champions: - Brian Terlson - Michael Ficarra + example: > + [1, [2, [3]]].flat(Infinity); // [1,2,3] + + [2, 3, 4].flatMap((x) => [x, x * 2]); // [[2, 4, 3, 6, 4, 8] resources: - https://github.com/tc39/proposal-flatMap From d1563c2eafb6bbd8111482f2f169d2a2535db51c Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 17 Jan 2019 07:11:45 +0530 Subject: [PATCH 05/14] example for String.prototype.{trimStart,trimEnd}. --- _data/stage3.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/_data/stage3.yml b/_data/stage3.yml index df585c0d..b430c4eb 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -145,7 +145,7 @@ - Michael Ficarra example: > [1, [2, [3]]].flat(Infinity); // [1,2,3] - + [2, 3, 4].flatMap((x) => [x, x * 2]); // [[2, 4, 3, 6, 4, 8] resources: - https://github.com/tc39/proposal-flatMap @@ -188,6 +188,10 @@ - Sebastian Markbåge tests: - https://github.com/tc39/test262/pull/1246 + example: > + " Hey JS!".trimStart(); // "Hey JS!" + + "Hey JS! ".trimEnd(); // "Hey JS!" resources: - https://tc39.github.io/proposal-string-left-right-trim/ From 51a0bdd1358b809760dc0158267fefa3d1c0df83 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 17 Jan 2019 10:38:15 +0530 Subject: [PATCH 06/14] example for String.prototype.matchAll --- _data/stage3.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/_data/stage3.yml b/_data/stage3.yml index b430c4eb..988dff53 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -204,6 +204,29 @@ tests: - https://github.com/tc39/test262/pull/1500 - https://github.com/tc39/test262/pull/1587 + example: > + var str = 'Hello world!!!'; + + var regexp = /(\w+)\W*/g; + + console.log(str.matchAll(regexp)); + + /* + [ + { + 0: "Hello ", + 1: "Hello" + index: 0, + input: "Hello world!!!" + }, + { + 0: "world!!!", + 1: "world" + index: 6, + input: "Hello world!!!" + } + ] + */ resources: - https://tc39.github.io/proposal-string-matchall/ From 048e058fc2f404bafb6079b590ae91f2eda10894 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 17 Jan 2019 10:44:06 +0530 Subject: [PATCH 07/14] example for Symbol.prototype.description. --- _data/stage3.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/_data/stage3.yml b/_data/stage3.yml index 988dff53..6f6593d9 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -238,6 +238,12 @@ - Michael Ficarra tests: - https://github.com/tc39/test262/pull/1590 + example: > + const symbol = Symbol('TC39'); + + console.log(symbol.description); // 'TC39' + + console.log(symbol.hasOwnProperty('description')); // false resources: - https://tc39.github.io/proposal-Symbol-description/ From d0e74ba4079c61813e6e70fabaed7a975886f426 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Thu, 17 Jan 2019 10:48:12 +0530 Subject: [PATCH 08/14] example for Object.fromEntries. --- _data/stage3.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/_data/stage3.yml b/_data/stage3.yml index 6f6593d9..9c843e43 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -254,6 +254,15 @@ champions: - Jordan Harband - Kevin Gibbons + example: > + const entries = new Map([ + ['cat', 'dog'], + ['life', 42] + ]); + + const obj = Object.fromEntries(entries); + + console.log(obj); // { cat: "dog", life: 42 } tests: - https://github.com/tc39/test262/pull/1677 - https://github.com/tc39/test262/pull/1676 From 9e03c99bb060a1ddd182fdb65dc50aca0b53cdd1 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 19 Jan 2019 16:23:24 +0530 Subject: [PATCH 09/14] example for static private methods and Static private fields. --- _data/stage3.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/_data/stage3.yml b/_data/stage3.yml index 9c843e43..e8e1da06 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -179,6 +179,36 @@ specification: https://tc39.github.io/proposal-static-class-features/ resources: - https://tc39.github.io/proposal-static-class-features/ + example: > + class ColorFinder { + static #red = "#ff0000"; + + static #blue = "#00ff00"; + + static #green = "#0000ff"; + + // ^ static class fields + + static white = "white"; + + // ^ static public field. + + static colorName(name) { + switch (name) { + case "red": return ColorFinder.#red; + case "blue": return ColorFinder.#blue; + case "green": return ColorFinder.#green; + default: throw new RangeError("unknown color"); + } + } + + // Static method ^ + + static #setColor(name) { + + } + // ^ Static private method + } - title: String.prototype.{trimStart,trimEnd} description: A proposal to extend ECMA-262 syntax into a superset of JSON. From deb8b78254db22e7cea89dc6516a84158a3373b5 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 19 Jan 2019 16:27:16 +0530 Subject: [PATCH 10/14] example of Well-formed JSON.stringify. --- _data/stage3.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/_data/stage3.yml b/_data/stage3.yml index e8e1da06..4cf96678 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -308,6 +308,21 @@ tests: - https://github.com/tc39/test262/pull/1787 specification: https://tc39.github.io/proposal-well-formed-stringify/ + example: > + // Non-BMP characters still serialize to surrogate pairs. + JSON.stringify('𝌆') + // → '"𝌆"' + + JSON.stringify('\uD834\uDF06') + // → '"𝌆"' + + // Unpaired surrogate code units will serialize to escape sequences. + JSON.stringify('\uDF06\uD834') + // → '"\\udf06\\ud834"' + + JSON.stringify('\uDEAD') + // → '"\\udead"' + resources: - https://tc39.github.io/proposal-well-formed-stringify/ From 092edbd3864bc4da0a5d68ab2bda579549a1680a Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sat, 19 Jan 2019 16:35:09 +0530 Subject: [PATCH 11/14] example for class fields. --- _data/stage3.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/_data/stage3.yml b/_data/stage3.yml index 4cf96678..bfe57c1b 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -163,8 +163,17 @@ tests: - https://github.com/tc39/test262/issues/1161 specification: https://tc39.github.io/proposal-class-fields/ + example: > + class Foo { + instancePropertyBar = 0; + static staticPropertyBar = 0; + #privatePropertyBar = 0; + static #privatePropertyBar = 0; + + set foo(value) { console.log(value); } + } resources: - - https://github.com/tc39/proposal-numeric-separator + - https://github.com/tc39/proposal-class-fields - title: Static class fields and private static methods description: This proposal adds Static public fields, Static private methods and Static private fields @@ -319,7 +328,7 @@ // Unpaired surrogate code units will serialize to escape sequences. JSON.stringify('\uDF06\uD834') // → '"\\udf06\\ud834"' - + JSON.stringify('\uDEAD') // → '"\\udead"' From 711fd8327fde1dfec31f8b4dc267c870724abad9 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 20 Jan 2019 19:07:28 +0530 Subject: [PATCH 12/14] naming it iterableOfEntries instead. --- _data/stage3.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_data/stage3.yml b/_data/stage3.yml index bfe57c1b..dfe4bfca 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -294,12 +294,12 @@ - Jordan Harband - Kevin Gibbons example: > - const entries = new Map([ + const iterableOfEntries = new Map([ ['cat', 'dog'], ['life', 42] ]); - const obj = Object.fromEntries(entries); + const obj = Object.fromEntries(iterableOfEntries); console.log(obj); // { cat: "dog", life: 42 } tests: From a2884dc703e4231877615f2e80c3a354df74d968 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 20 Jan 2019 19:08:24 +0530 Subject: [PATCH 13/14] fixed syntax error in flatMap. --- _data/stage3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/stage3.yml b/_data/stage3.yml index dfe4bfca..f920a4a1 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -146,7 +146,7 @@ example: > [1, [2, [3]]].flat(Infinity); // [1,2,3] - [2, 3, 4].flatMap((x) => [x, x * 2]); // [[2, 4, 3, 6, 4, 8] + [2, 3, 4].flatMap((x) => [x, x * 2]); // [2, 4, 3, 6, 4, 8] resources: - https://github.com/tc39/proposal-flatMap From 8fed7764a5a6973b31f129c357885b668392c96a Mon Sep 17 00:00:00 2001 From: codehag Date: Thu, 28 Feb 2019 15:03:57 +0100 Subject: [PATCH 14/14] remove stage 4 proposals --- _data/stage3.yml | 120 +---------------------------------------------- 1 file changed, 2 insertions(+), 118 deletions(-) diff --git a/_data/stage3.yml b/_data/stage3.yml index f920a4a1..85cdb98c 100644 --- a/_data/stage3.yml +++ b/_data/stage3.yml @@ -1,22 +1,3 @@ -- title: Function.prototype.toString revision - description: for functions defined using ECMAScript code, toString must return source text slice from beginning of first token to end of last token matched by the appropriate grammar production - authors: - - Michael Ficarra - champions: - - Michael Ficarra - tests: - - https://github.com/tc39/test262/issues/1163 - specification: https://tc39.github.io/Function-prototype-toString-revision/ - example: > - // String's parse must contains the same - // function body and parameter list as the original. - - O.gOPD({ get a(){} }, "a").get // "function a(){}" - - O.gOPD({ set a(b){} }, "a").set // "function a(b){}" - resources: - - https://github.com/tc39/Function-prototype-toString-revision - - title: globalThis description: ECMAScript Proposal, specs, and reference implementation for globalThis authors: @@ -112,7 +93,7 @@ get #x() { return #xValue; } set #x(value) { - this.#xValue = value; + this.#xValue = value; window.requestAnimationFrame(this.#render.bind(this)); } @@ -135,21 +116,6 @@ resources: - https://github.com/tc39/proposal-private-methods -- title: Array.prototype.{flat,flatMap} - description: Proposal for flatten and flatMap on arrays - authors: - - Brian Terlson - - Michael Ficarra - champions: - - Brian Terlson - - Michael Ficarra - example: > - [1, [2, [3]]].flat(Infinity); // [1,2,3] - - [2, 3, 4].flatMap((x) => [x, x * 2]); // [2, 4, 3, 6, 4, 8] - resources: - - https://github.com/tc39/proposal-flatMap - - title: Class Public Instance Fields & Private Instance Fields description: This proposes a combined vision for public fields and private fields, drawing on the earlier Orthogonal Classes and Class Evaluation Order proposals. authors: @@ -199,7 +165,7 @@ // ^ static class fields static white = "white"; - + // ^ static public field. static colorName(name) { @@ -219,21 +185,6 @@ // ^ Static private method } -- title: String.prototype.{trimStart,trimEnd} - description: A proposal to extend ECMA-262 syntax into a superset of JSON. - authors: - - Sebastian Markbåge - champions: - - Sebastian Markbåge - tests: - - https://github.com/tc39/test262/pull/1246 - example: > - " Hey JS!".trimStart(); // "Hey JS!" - - "Hey JS! ".trimEnd(); // "Hey JS!" - resources: - - https://tc39.github.io/proposal-string-left-right-trim/ - - title: String.prototype.matchAll description: If given a string, and either a sticky or a global regular expression which has multiple capturing groups, we often want to iterate through all of the matches. authors: @@ -268,70 +219,3 @@ */ resources: - https://tc39.github.io/proposal-string-matchall/ - -- title: Symbol.prototype.description - description: Expose the [[Description]] internal slot of a symbol directly instead of just indirectly through Symbol.prototype.toString. - authors: - - Michael Ficarra - champions: - - Michael Ficarra - tests: - - https://github.com/tc39/test262/pull/1590 - example: > - const symbol = Symbol('TC39'); - - console.log(symbol.description); // 'TC39' - - console.log(symbol.hasOwnProperty('description')); // false - resources: - - https://tc39.github.io/proposal-Symbol-description/ - -- title: Object.fromEntries - description: A proposal for a new static method Object.fromEntries in ECMAScript for transforming a list of key-value pairs into an object. - authors: - - Darien Maillet Valentine - champions: - - Jordan Harband - - Kevin Gibbons - example: > - const iterableOfEntries = new Map([ - ['cat', 'dog'], - ['life', 42] - ]); - - const obj = Object.fromEntries(iterableOfEntries); - - console.log(obj); // { cat: "dog", life: 42 } - tests: - - https://github.com/tc39/test262/pull/1677 - - https://github.com/tc39/test262/pull/1676 - resources: - - https://tc39.github.io/proposal-object-from-entries/ - -- title: Well-formed JSON.stringify - description: A proposal to prevent JSON.stringify from returning ill-formed Unicode strings. - authors: - - Richard Gibson - champions: - - Mathias Bynens - tests: - - https://github.com/tc39/test262/pull/1787 - specification: https://tc39.github.io/proposal-well-formed-stringify/ - example: > - // Non-BMP characters still serialize to surrogate pairs. - JSON.stringify('𝌆') - // → '"𝌆"' - - JSON.stringify('\uD834\uDF06') - // → '"𝌆"' - - // Unpaired surrogate code units will serialize to escape sequences. - JSON.stringify('\uDF06\uD834') - // → '"\\udf06\\ud834"' - - JSON.stringify('\uDEAD') - // → '"\\udead"' - - resources: - - https://tc39.github.io/proposal-well-formed-stringify/ -