Debian Codegraph @

js/src/tests/test262/language/expressions/async-arrow-function/shell.js

raw
1 // GENERATED, DO NOT EDIT
2 // file: wellKnownIntrinsicObjects.js
3 // Copyright (C) 2018 the V8 project authors. All rights reserved.
4 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 description: |
7 An Array of all representable Well-Known Intrinsic Objects
8 defines: [WellKnownIntrinsicObjects, getWellKnownIntrinsicObject]
9 ---*/
10
11 const WellKnownIntrinsicObjects = [
12 {
13 name: '%AggregateError%',
14 source: 'AggregateError',
15 },
16 {
17 name: '%Array%',
18 source: 'Array',
19 },
20 {
21 name: '%ArrayBuffer%',
22 source: 'ArrayBuffer',
23 },
24 {
25 name: '%ArrayIteratorPrototype%',
26 source: 'Object.getPrototypeOf([][Symbol.iterator]())',
27 },
28 {
29 // Not currently accessible to ECMAScript user code
30 name: '%AsyncFromSyncIteratorPrototype%',
31 source: '',
32 },
33 {
34 name: '%AsyncFunction%',
35 source: '(async function() {}).constructor',
36 },
37 {
38 name: '%AsyncGeneratorFunction%',
39 source: '(async function* () {}).constructor',
40 },
41 {
42 name: '%AsyncGeneratorPrototype%',
43 source: 'Object.getPrototypeOf(async function* () {}).prototype',
44 },
45 {
46 name: '%AsyncIteratorPrototype%',
47 source: '((async function * () {})())[Symbol.asyncIterator]()',
48 },
49 {
50 name: '%Atomics%',
51 source: 'Atomics',
52 },
53 {
54 name: '%BigInt%',
55 source: 'BigInt',
56 },
57 {
58 name: '%BigInt64Array%',
59 source: 'BigInt64Array',
60 },
61 {
62 name: '%BigUint64Array%',
63 source: 'BigUint64Array',
64 },
65 {
66 name: '%Boolean%',
67 source: 'Boolean',
68 },
69 {
70 name: '%DataView%',
71 source: 'DataView',
72 },
73 {
74 name: '%Date%',
75 source: 'Date',
76 },
77 {
78 name: '%decodeURI%',
79 source: 'decodeURI',
80 },
81 {
82 name: '%decodeURIComponent%',
83 source: 'decodeURIComponent',
84 },
85 {
86 name: '%encodeURI%',
87 source: 'encodeURI',
88 },
89 {
90 name: '%encodeURIComponent%',
91 source: 'encodeURIComponent',
92 },
93 {
94 name: '%Error%',
95 source: 'Error',
96 },
97 {
98 name: '%eval%',
99 source: 'eval',
100 },
101 {
102 name: '%EvalError%',
103 source: 'EvalError',
104 },
105 {
106 name: '%FinalizationRegistry%',
107 source: 'FinalizationRegistry',
108 },
109 {
110 name: '%Float32Array%',
111 source: 'Float32Array',
112 },
113 {
114 name: '%Float64Array%',
115 source: 'Float64Array',
116 },
117 {
118 // Not currently accessible to ECMAScript user code
119 name: '%ForInIteratorPrototype%',
120 source: '',
121 },
122 {
123 name: '%Function%',
124 source: 'Function',
125 },
126 {
127 name: '%GeneratorFunction%',
128 source: '(function* () {}).constructor',
129 },
130 {
131 name: '%GeneratorPrototype%',
132 source: 'Object.getPrototypeOf(function * () {}).prototype',
133 },
134 {
135 name: '%Int8Array%',
136 source: 'Int8Array',
137 },
138 {
139 name: '%Int16Array%',
140 source: 'Int16Array',
141 },
142 {
143 name: '%Int32Array%',
144 source: 'Int32Array',
145 },
146 {
147 name: '%isFinite%',
148 source: 'isFinite',
149 },
150 {
151 name: '%isNaN%',
152 source: 'isNaN',
153 },
154 {
155 name: '%Iterator%',
156 source: 'typeof Iterator !== "undefined" ? Iterator : Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())).constructor',
157 },
158 {
159 name: '%IteratorHelperPrototype%',
160 source: 'Object.getPrototypeOf(Iterator.from([]).drop(0))',
161 },
162 {
163 name: '%JSON%',
164 source: 'JSON',
165 },
166 {
167 name: '%Map%',
168 source: 'Map',
169 },
170 {
171 name: '%MapIteratorPrototype%',
172 source: 'Object.getPrototypeOf(new Map()[Symbol.iterator]())',
173 },
174 {
175 name: '%Math%',
176 source: 'Math',
177 },
178 {
179 name: '%Number%',
180 source: 'Number',
181 },
182 {
183 name: '%Object%',
184 source: 'Object',
185 },
186 {
187 name: '%parseFloat%',
188 source: 'parseFloat',
189 },
190 {
191 name: '%parseInt%',
192 source: 'parseInt',
193 },
194 {
195 name: '%Promise%',
196 source: 'Promise',
197 },
198 {
199 name: '%Proxy%',
200 source: 'Proxy',
201 },
202 {
203 name: '%RangeError%',
204 source: 'RangeError',
205 },
206 {
207 name: '%ReferenceError%',
208 source: 'ReferenceError',
209 },
210 {
211 name: '%Reflect%',
212 source: 'Reflect',
213 },
214 {
215 name: '%RegExp%',
216 source: 'RegExp',
217 },
218 {
219 name: '%RegExpStringIteratorPrototype%',
220 source: 'RegExp.prototype[Symbol.matchAll]("")',
221 },
222 {
223 name: '%Set%',
224 source: 'Set',
225 },
226 {
227 name: '%SetIteratorPrototype%',
228 source: 'Object.getPrototypeOf(new Set()[Symbol.iterator]())',
229 },
230 {
231 name: '%SharedArrayBuffer%',
232 source: 'SharedArrayBuffer',
233 },
234 {
235 name: '%String%',
236 source: 'String',
237 },
238 {
239 name: '%StringIteratorPrototype%',
240 source: 'Object.getPrototypeOf(new String()[Symbol.iterator]())',
241 },
242 {
243 name: '%Symbol%',
244 source: 'Symbol',
245 },
246 {
247 name: '%SyntaxError%',
248 source: 'SyntaxError',
249 },
250 {
251 name: '%ThrowTypeError%',
252 source: '(function() { "use strict"; return Object.getOwnPropertyDescriptor(arguments, "callee").get })()',
253 },
254 {
255 name: '%TypedArray%',
256 source: 'Object.getPrototypeOf(Uint8Array)',
257 },
258 {
259 name: '%TypeError%',
260 source: 'TypeError',
261 },
262 {
263 name: '%Uint8Array%',
264 source: 'Uint8Array',
265 },
266 {
267 name: '%Uint8ClampedArray%',
268 source: 'Uint8ClampedArray',
269 },
270 {
271 name: '%Uint16Array%',
272 source: 'Uint16Array',
273 },
274 {
275 name: '%Uint32Array%',
276 source: 'Uint32Array',
277 },
278 {
279 name: '%URIError%',
280 source: 'URIError',
281 },
282 {
283 name: '%WeakMap%',
284 source: 'WeakMap',
285 },
286 {
287 name: '%WeakRef%',
288 source: 'WeakRef',
289 },
290 {
291 name: '%WeakSet%',
292 source: 'WeakSet',
293 },
294 {
295 name: '%WrapForValidIteratorPrototype%',
296 source: 'Object.getPrototypeOf(Iterator.from({ [Symbol.iterator](){ return {}; } }))',
297 },
298 ];
299
300 WellKnownIntrinsicObjects.forEach((wkio) => {
301 var actual;
302
303 try {
304 actual = new Function("return " + wkio.source)();
305 } catch (exception) {
306 // Nothing to do here.
307 }
308
309 wkio.value = actual;
310 });
311
312 /**
313 * Returns a well-known intrinsic object, if the implementation provides it.
314 * Otherwise, throws.
315 * @param {string} key - the specification's name for the intrinsic, for example
316 * "%Array%"
317 * @returns {object} the well-known intrinsic object.
318 */
319 function getWellKnownIntrinsicObject(key) {
320 for (var ix = 0; ix < WellKnownIntrinsicObjects.length; ix++) {
321 if (WellKnownIntrinsicObjects[ix].name === key) {
322 var value = WellKnownIntrinsicObjects[ix].value;
323 if (value !== undefined)
324 return value;
325 throw new Test262Error('this implementation could not obtain ' + key);
326 }
327 }
328 throw new Test262Error('unknown well-known intrinsic ' + key);
329 }