23
23
'use strict' ;
24
24
25
25
const {
26
+ AggregateError,
27
+ AggregateErrorPrototype,
26
28
Array,
27
29
ArrayBuffer,
28
30
ArrayBufferPrototype,
31
+ ArrayIteratorPrototype,
29
32
ArrayPrototype,
30
33
ArrayPrototypeForEach,
31
34
ArrayPrototypePush,
@@ -45,6 +48,8 @@ const {
45
48
ErrorPrototype,
46
49
EvalError,
47
50
EvalErrorPrototype,
51
+ FinalizationRegistry,
52
+ FinalizationRegistryPrototype,
48
53
Float32Array,
49
54
Float32ArrayPrototype,
50
55
Float64Array,
@@ -84,9 +89,11 @@ const {
84
89
Set,
85
90
SetPrototype,
86
91
String,
92
+ StringIteratorPrototype,
87
93
StringPrototype,
88
94
Symbol,
89
95
SymbolIterator,
96
+ SymbolMatchAll,
90
97
SyntaxError,
91
98
SyntaxErrorPrototype,
92
99
TypeError,
@@ -105,6 +112,8 @@ const {
105
112
URIErrorPrototype,
106
113
WeakMap,
107
114
WeakMapPrototype,
115
+ WeakRef,
116
+ WeakRefPrototype,
108
117
WeakSet,
109
118
WeakSetPrototype,
110
119
decodeURI,
@@ -124,52 +133,37 @@ module.exports = function() {
124
133
} = require ( 'timers' ) ;
125
134
126
135
const intrinsicPrototypes = [
127
- // Anonymous Intrinsics
128
- // IteratorPrototype
129
- ObjectGetPrototypeOf (
130
- ObjectGetPrototypeOf ( new Array ( ) [ SymbolIterator ] ( ) )
131
- ) ,
132
- // ArrayIteratorPrototype
133
- ObjectGetPrototypeOf ( new Array ( ) [ SymbolIterator ] ( ) ) ,
134
- // StringIteratorPrototype
135
- ObjectGetPrototypeOf ( new String ( ) [ SymbolIterator ] ( ) ) ,
136
- // MapIteratorPrototype
137
- ObjectGetPrototypeOf ( new Map ( ) [ SymbolIterator ] ( ) ) ,
138
- // SetIteratorPrototype
139
- ObjectGetPrototypeOf ( new Set ( ) [ SymbolIterator ] ( ) ) ,
140
- // GeneratorFunction
141
- ObjectGetPrototypeOf ( function * ( ) { } ) ,
142
- // AsyncFunction
143
- ObjectGetPrototypeOf ( async function ( ) { } ) ,
144
- // AsyncGeneratorFunction
145
- ObjectGetPrototypeOf ( async function * ( ) { } ) ,
146
- // TypedArray
147
- TypedArrayPrototype ,
148
-
149
- // 19 Fundamental Objects
150
- ObjectPrototype , // 19.1
151
- FunctionPrototype , // 19.2
152
- BooleanPrototype , // 19.3
136
+ // 21 Fundamental Objects
137
+ ObjectPrototype , // 20.1
138
+ FunctionPrototype , // 20.2
139
+ BooleanPrototype , // 20.3
153
140
154
- ErrorPrototype , // 19.5
141
+ ErrorPrototype , // 20.5
142
+ AggregateErrorPrototype ,
155
143
EvalErrorPrototype ,
156
144
RangeErrorPrototype ,
157
145
ReferenceErrorPrototype ,
158
146
SyntaxErrorPrototype ,
159
147
TypeErrorPrototype ,
160
148
URIErrorPrototype ,
161
149
162
- // 20 Numbers and Dates
163
- NumberPrototype , // 20.1
164
- DatePrototype , // 20.3
150
+ // 21 Numbers and Dates
151
+ NumberPrototype , // 21.1
152
+ BigIntPrototype , // 21.2
153
+ DatePrototype , // 21.4
165
154
166
- // 21 Text Processing
167
- StringPrototype , // 21.1
168
- RegExpPrototype , // 21.2
155
+ // 22 Text Processing
156
+ StringPrototype , // 22.1
157
+ StringIteratorPrototype , // 22.1.5
158
+ RegExpPrototype , // 22.2
159
+ // 22.2.7 RegExpStringIteratorPrototype
160
+ ObjectGetPrototypeOf ( / e / [ SymbolMatchAll ] ( ) ) ,
169
161
170
- // 22 Indexed Collections
171
- ArrayPrototype , // 22.1
162
+ // 23 Indexed Collections
163
+ ArrayPrototype , // 23.1
164
+ ArrayIteratorPrototype , // 23.1.5
172
165
166
+ TypedArrayPrototype , // 23.2
173
167
Int8ArrayPrototype ,
174
168
Uint8ArrayPrototype ,
175
169
Uint8ClampedArrayPrototype ,
@@ -182,55 +176,52 @@ module.exports = function() {
182
176
BigInt64ArrayPrototype ,
183
177
BigUint64ArrayPrototype ,
184
178
185
- // 23 Keyed Collections
186
- MapPrototype , // 23.1
187
- SetPrototype , // 23.2
188
- WeakMapPrototype , // 23.3
189
- WeakSetPrototype , // 23.4
190
-
191
- // 24 Structured Data
192
- ArrayBufferPrototype , // 24.1
193
- DataViewPrototype , // 24.3
194
- PromisePrototype , // 25.4
179
+ // 24 Keyed Collections
180
+ MapPrototype , // 24.1
181
+ // 24.1.5 MapIteratorPrototype
182
+ ObjectGetPrototypeOf ( new Map ( ) [ SymbolIterator ] ( ) ) ,
183
+ SetPrototype , // 24.2
184
+ // 24.2.5 SetIteratorPrototype
185
+ ObjectGetPrototypeOf ( new Set ( ) [ SymbolIterator ] ( ) ) ,
186
+ WeakMapPrototype , // 24.3
187
+ WeakSetPrototype , // 24.4
188
+
189
+ // 25 Structured Data
190
+ ArrayBufferPrototype , // 25.1
191
+ SharedArrayBuffer . prototype , // 25.2
192
+ DataViewPrototype , // 25.3
193
+
194
+ // 26 Managing Memory
195
+ WeakRefPrototype , // 26.1
196
+ FinalizationRegistryPrototype , // 26.2
197
+
198
+ // 27 Control Abstraction Objects
199
+ // 27.1 Iteration
200
+ ObjectGetPrototypeOf ( ArrayIteratorPrototype ) , // 27.1.2 IteratorPrototype
201
+ // 27.1.3 AsyncIteratorPrototype
202
+ ObjectGetPrototypeOf ( ObjectGetPrototypeOf ( ObjectGetPrototypeOf (
203
+ ( async function * ( ) { } ) ( )
204
+ ) ) ) ,
205
+ PromisePrototype , // 27.2
195
206
196
207
// Other APIs / Web Compatibility
197
208
console . Console . prototype ,
198
- BigIntPrototype ,
199
209
WebAssembly . Module . prototype ,
200
210
WebAssembly . Instance . prototype ,
201
211
WebAssembly . Table . prototype ,
202
212
WebAssembly . Memory . prototype ,
203
213
WebAssembly . CompileError . prototype ,
204
214
WebAssembly . LinkError . prototype ,
205
215
WebAssembly . RuntimeError . prototype ,
206
- SharedArrayBuffer . prototype ,
207
216
] ;
208
217
const intrinsics = [
209
- // Anonymous Intrinsics
210
- // ThrowTypeError
218
+ // 10.2.4.1 ThrowTypeError
211
219
ObjectGetOwnPropertyDescriptor ( FunctionPrototype , 'caller' ) . get ,
212
- // IteratorPrototype
213
- ObjectGetPrototypeOf (
214
- ObjectGetPrototypeOf ( new Array ( ) [ SymbolIterator ] ( ) )
215
- ) ,
216
- // ArrayIteratorPrototype
217
- ObjectGetPrototypeOf ( new Array ( ) [ SymbolIterator ] ( ) ) ,
218
- // StringIteratorPrototype
219
- ObjectGetPrototypeOf ( new String ( ) [ SymbolIterator ] ( ) ) ,
220
- // MapIteratorPrototype
221
- ObjectGetPrototypeOf ( new Map ( ) [ SymbolIterator ] ( ) ) ,
222
- // SetIteratorPrototype
223
- ObjectGetPrototypeOf ( new Set ( ) [ SymbolIterator ] ( ) ) ,
224
- // GeneratorFunction
225
- ObjectGetPrototypeOf ( function * ( ) { } ) ,
226
- // AsyncFunction
227
- ObjectGetPrototypeOf ( async function ( ) { } ) ,
228
- // AsyncGeneratorFunction
229
- ObjectGetPrototypeOf ( async function * ( ) { } ) ,
230
- // TypedArray
231
- TypedArray ,
232
220
233
- // 18 The Global Object
221
+ // 19 The Global Object
222
+ // 19.1 Value Properties of the Global Object
223
+ globalThis , // eslint-disable-line no-restricted-globals
224
+ // 19.2 Function Properties of the Global Object
234
225
eval ,
235
226
// eslint-disable-next-line node-core/prefer-primordials
236
227
isFinite ,
@@ -240,38 +231,46 @@ module.exports = function() {
240
231
parseFloat ,
241
232
// eslint-disable-next-line node-core/prefer-primordials
242
233
parseInt ,
234
+ // 19.2.6 URI Handling Functions
243
235
decodeURI ,
244
236
decodeURIComponent ,
245
237
encodeURI ,
246
238
encodeURIComponent ,
247
239
248
- // 19 Fundamental Objects
249
- Object , // 19 .1
250
- Function , // 19 .2
251
- Boolean , // 19 .3
252
- Symbol , // 19 .4
240
+ // 20 Fundamental Objects
241
+ Object , // 20 .1
242
+ Function , // 20 .2
243
+ Boolean , // 20 .3
244
+ Symbol , // 20 .4
253
245
254
- Error , // 19.5
246
+ Error , // 20.5
247
+ AggregateError ,
255
248
EvalError ,
256
249
RangeError ,
257
250
ReferenceError ,
258
251
SyntaxError ,
259
252
TypeError ,
260
253
URIError ,
261
254
262
- // 20 Numbers and Dates
263
- Number , // 20.1
255
+ // 21 Numbers and Dates
256
+ Number , // 21.1
257
+ BigInt , // 21.2
264
258
// eslint-disable-next-line node-core/prefer-primordials
265
- Math , // 20.2
266
- Date , // 20.3
267
-
268
- // 21 Text Processing
269
- String , // 21.1
270
- RegExp , // 21.2
271
-
272
- // 22 Indexed Collections
273
- Array , // 22.1
274
-
259
+ Math , // 21.3
260
+ Date , // 21.4
261
+
262
+ // 22 Text Processing
263
+ String , // 22.1
264
+ StringIteratorPrototype , // 22.1.5
265
+ RegExp , // 22.2
266
+ // 22.2.7 RegExpStringIteratorPrototype
267
+ ObjectGetPrototypeOf ( / e / [ SymbolMatchAll ] ( ) ) ,
268
+
269
+ // 23 Indexed Collections
270
+ Array , // 23.1
271
+ ArrayIteratorPrototype , // 23.1.5
272
+ // 23.2 TypedArray
273
+ TypedArray ,
275
274
Int8Array ,
276
275
Uint8Array ,
277
276
Uint8ClampedArray ,
@@ -284,23 +283,47 @@ module.exports = function() {
284
283
BigInt64Array ,
285
284
BigUint64Array ,
286
285
287
- // 23 Keyed Collections
288
- Map , // 23.1
289
- Set , // 23.2
290
- WeakMap , // 23.3
291
- WeakSet , // 23.4
292
-
293
- // 24 Structured Data
294
- ArrayBuffer , // 24.1
295
- DataView , // 24.3
286
+ // 24 Keyed Collections
287
+ Map , // 24.1
288
+ // 24.1.5 MapIteratorPrototype
289
+ ObjectGetPrototypeOf ( new Map ( ) [ SymbolIterator ] ( ) ) ,
290
+ Set , // 24.2
291
+ // 24.2.5 SetIteratorPrototype
292
+ ObjectGetPrototypeOf ( new Set ( ) [ SymbolIterator ] ( ) ) ,
293
+ WeakMap , // 24.3
294
+ WeakSet , // 24.4
295
+
296
+ // 25 Structured Data
297
+ ArrayBuffer , // 25.1
298
+ SharedArrayBuffer , // 25.2
299
+ DataView , // 25.3
300
+ Atomics , // 25.4
296
301
// eslint-disable-next-line node-core/prefer-primordials
297
- JSON , // 24.5
298
- Promise , // 25.4
302
+ JSON , // 25.5
303
+
304
+ // 26 Managing Memory
305
+ WeakRef , // 26.1
306
+ FinalizationRegistry , // 26.2
307
+
308
+ // 27 Control Abstraction Objects
309
+ // 27.1 Iteration
310
+ ObjectGetPrototypeOf ( ArrayIteratorPrototype ) , // 27.1.2 IteratorPrototype
311
+ // 27.1.3 AsyncIteratorPrototype
312
+ ObjectGetPrototypeOf ( ObjectGetPrototypeOf ( ObjectGetPrototypeOf (
313
+ ( async function * ( ) { } ) ( )
314
+ ) ) ) ,
315
+ Promise , // 27.2
316
+ // 27.3 GeneratorFunction
317
+ ObjectGetPrototypeOf ( function * ( ) { } ) ,
318
+ // 27.4 AsyncGeneratorFunction
319
+ ObjectGetPrototypeOf ( async function * ( ) { } ) ,
320
+ // 27.7 AsyncFunction
321
+ ObjectGetPrototypeOf ( async function ( ) { } ) ,
299
322
300
- // 26 Reflection
323
+ // 28 Reflection
301
324
// eslint-disable-next-line node-core/prefer-primordials
302
- Reflect , // 26 .1
303
- Proxy , // 26 .2
325
+ Reflect , // 28 .1
326
+ Proxy , // 28 .2
304
327
305
328
// B.2.1
306
329
escape ,
@@ -314,10 +337,7 @@ module.exports = function() {
314
337
setInterval ,
315
338
setTimeout ,
316
339
console ,
317
- BigInt ,
318
- Atomics ,
319
340
WebAssembly ,
320
- SharedArrayBuffer ,
321
341
] ;
322
342
323
343
if ( typeof Intl !== 'undefined' ) {
0 commit comments