|
1 |
| -- title: Function.prototype.toString revision |
2 |
| - 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 |
3 |
| - authors: |
4 |
| - - Michael Ficarra |
5 |
| - champions: |
6 |
| - - Michael Ficarra |
7 |
| - tests: |
8 |
| - - https://github.com/tc39/test262/issues/1163 |
9 |
| - specification: https://tc39.github.io/Function-prototype-toString-revision/ |
10 |
| - resources: |
11 |
| - - https://github.com/tc39/Function-prototype-toString-revision |
12 |
| - |
13 | 1 | - title: globalThis
|
14 | 2 | description: ECMAScript Proposal, specs, and reference implementation for globalThis
|
15 | 3 | authors:
|
|
67 | 55 | - Daniel Ehrenberg
|
68 | 56 | tests:
|
69 | 57 | - https://github.com/tc39/test262/issues/1056
|
| 58 | + example: > |
| 59 | + const theBiggestInt = 9007199254740991n; |
| 60 | +
|
| 61 | + const alsoHuge = BigInt(9007199254740991); |
| 62 | + // ↪ 9007199254740991n |
| 63 | +
|
| 64 | + const hugeButString = BigInt('9007199254740991'); |
| 65 | + // ↪ 9007199254740991n |
70 | 66 | resources:
|
71 | 67 | - https://github.com/tc39/proposal-bigint
|
72 | 68 |
|
|
91 | 87 | - Kevin Gibbons
|
92 | 88 | tests:
|
93 | 89 | - https://github.com/tc39/test262/issues/1343
|
94 |
| - resources: |
95 |
| - - https://github.com/tc39/proposal-private-methods |
| 90 | + example: > |
| 91 | + class Counter extends HTMLElement { |
| 92 | + #xValue = 0; |
96 | 93 |
|
97 |
| -- title: Array.prototype.{flat,flatMap} |
98 |
| - description: Proposal for flatten and flatMap on arrays |
99 |
| - authors: |
100 |
| - - Brian Terlson |
101 |
| - - Michael Ficarra |
102 |
| - champions: |
103 |
| - - Brian Terlson |
104 |
| - - Michael Ficarra |
| 94 | + get #x() { return #xValue; } |
| 95 | + set #x(value) { |
| 96 | + this.#xValue = value; |
| 97 | + window.requestAnimationFrame(this.#render.bind(this)); |
| 98 | + } |
| 99 | +
|
| 100 | + #clicked() { |
| 101 | + this.#x++; |
| 102 | + } |
| 103 | +
|
| 104 | + constructor() { |
| 105 | + super(); |
| 106 | + this.onclick = this.#clicked.bind(this); |
| 107 | + } |
| 108 | +
|
| 109 | + connectedCallback() { this.#render(); } |
| 110 | +
|
| 111 | + #render() { |
| 112 | + this.textContent = this.#x.toString(); |
| 113 | + } |
| 114 | + } |
| 115 | + window.customElements.define('num-counter', Counter); |
105 | 116 | resources:
|
106 |
| - - https://github.com/tc39/proposal-flatMap |
| 117 | + - https://github.com/tc39/proposal-private-methods |
107 | 118 |
|
108 | 119 | - title: Class Public Instance Fields & Private Instance Fields
|
109 | 120 | description: This proposes a combined vision for public fields and private fields, drawing on the earlier Orthogonal Classes and Class Evaluation Order proposals.
|
|
118 | 129 | tests:
|
119 | 130 | - https://github.com/tc39/test262/issues/1161
|
120 | 131 | specification: https://tc39.github.io/proposal-class-fields/
|
| 132 | + example: > |
| 133 | + class Foo { |
| 134 | + instancePropertyBar = 0; |
| 135 | + static staticPropertyBar = 0; |
| 136 | + #privatePropertyBar = 0; |
| 137 | + static #privatePropertyBar = 0; |
| 138 | +
|
| 139 | + set foo(value) { console.log(value); } |
| 140 | + } |
121 | 141 | resources:
|
122 |
| - - https://github.com/tc39/proposal-numeric-separator |
| 142 | + - https://github.com/tc39/proposal-class-fields |
123 | 143 |
|
124 | 144 | - title: Static class fields and private static methods
|
125 | 145 | description: This proposal adds Static public fields, Static private methods and Static private fields
|
|
134 | 154 | specification: https://tc39.github.io/proposal-static-class-features/
|
135 | 155 | resources:
|
136 | 156 | - https://tc39.github.io/proposal-static-class-features/
|
| 157 | + example: > |
| 158 | + class ColorFinder { |
| 159 | + static #red = "#ff0000"; |
137 | 160 |
|
138 |
| -- title: String.prototype.{trimStart,trimEnd} |
139 |
| - description: A proposal to extend ECMA-262 syntax into a superset of JSON. |
140 |
| - authors: |
141 |
| - - Sebastian Markbåge |
142 |
| - champions: |
143 |
| - - Sebastian Markbåge |
144 |
| - tests: |
145 |
| - - https://github.com/tc39/test262/pull/1246 |
146 |
| - resources: |
147 |
| - - https://tc39.github.io/proposal-string-left-right-trim/ |
| 161 | + static #blue = "#00ff00"; |
| 162 | +
|
| 163 | + static #green = "#0000ff"; |
| 164 | +
|
| 165 | + // ^ static class fields |
| 166 | +
|
| 167 | + static white = "white"; |
| 168 | +
|
| 169 | + // ^ static public field. |
| 170 | +
|
| 171 | + static colorName(name) { |
| 172 | + switch (name) { |
| 173 | + case "red": return ColorFinder.#red; |
| 174 | + case "blue": return ColorFinder.#blue; |
| 175 | + case "green": return ColorFinder.#green; |
| 176 | + default: throw new RangeError("unknown color"); |
| 177 | + } |
| 178 | + } |
| 179 | +
|
| 180 | + // Static method ^ |
| 181 | +
|
| 182 | + static #setColor(name) { |
| 183 | +
|
| 184 | + } |
| 185 | + // ^ Static private method |
| 186 | + } |
148 | 187 |
|
149 | 188 | - title: String.prototype.matchAll
|
150 | 189 | 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.
|
|
155 | 194 | tests:
|
156 | 195 | - https://github.com/tc39/test262/pull/1500
|
157 | 196 | - https://github.com/tc39/test262/pull/1587
|
| 197 | + example: > |
| 198 | + var str = 'Hello world!!!'; |
| 199 | +
|
| 200 | + var regexp = /(\w+)\W*/g; |
| 201 | +
|
| 202 | + console.log(str.matchAll(regexp)); |
| 203 | +
|
| 204 | + /* |
| 205 | + [ |
| 206 | + { |
| 207 | + 0: "Hello ", |
| 208 | + 1: "Hello" |
| 209 | + index: 0, |
| 210 | + input: "Hello world!!!" |
| 211 | + }, |
| 212 | + { |
| 213 | + 0: "world!!!", |
| 214 | + 1: "world" |
| 215 | + index: 6, |
| 216 | + input: "Hello world!!!" |
| 217 | + } |
| 218 | + ] |
| 219 | + */ |
158 | 220 | resources:
|
159 | 221 | - https://tc39.github.io/proposal-string-matchall/
|
160 |
| - |
161 |
| -- title: Symbol.prototype.description |
162 |
| - description: Expose the [[Description]] internal slot of a symbol directly instead of just indirectly through Symbol.prototype.toString. |
163 |
| - authors: |
164 |
| - - Michael Ficarra |
165 |
| - champions: |
166 |
| - - Michael Ficarra |
167 |
| - tests: |
168 |
| - - https://github.com/tc39/test262/pull/1590 |
169 |
| - resources: |
170 |
| - - https://tc39.github.io/proposal-Symbol-description/ |
171 |
| - |
172 |
| -- title: Object.fromEntries |
173 |
| - description: A proposal for a new static method Object.fromEntries in ECMAScript for transforming a list of key-value pairs into an object. |
174 |
| - authors: |
175 |
| - - Darien Maillet Valentine |
176 |
| - champions: |
177 |
| - - Jordan Harband |
178 |
| - - Kevin Gibbons |
179 |
| - tests: |
180 |
| - - https://github.com/tc39/test262/pull/1677 |
181 |
| - - https://github.com/tc39/test262/pull/1676 |
182 |
| - resources: |
183 |
| - - https://tc39.github.io/proposal-object-from-entries/ |
184 |
| - |
185 |
| -- title: Well-formed JSON.stringify |
186 |
| - description: A proposal to prevent JSON.stringify from returning ill-formed Unicode strings. |
187 |
| - authors: |
188 |
| - - Richard Gibson |
189 |
| - champions: |
190 |
| - - Mathias Bynens |
191 |
| - tests: |
192 |
| - - https://github.com/tc39/test262/pull/1787 |
193 |
| - specification: https://tc39.github.io/proposal-well-formed-stringify/ |
194 |
| - resources: |
195 |
| - - https://tc39.github.io/proposal-well-formed-stringify/ |
196 |
| - |
|
0 commit comments