Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / DataView / shell.js
blob6bf8be5e31799998f5c8124d48f970b37ae536e1
1 // GENERATED, DO NOT EDIT
2 // file: byteConversionValues.js
3 // Copyright (C) 2016 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     Provide a list for original and expected values for different byte
8     conversions.
9     This helper is mostly used on tests for TypedArray and DataView, and each
10     array from the expected values must match the original values array on every
11     index containing its original value.
12 defines: [byteConversionValues]
13 ---*/
14 var byteConversionValues = {
15   values: [
16     127,         // 2 ** 7 - 1
17     128,         // 2 ** 7
18     32767,       // 2 ** 15 - 1
19     32768,       // 2 ** 15
20     2147483647,  // 2 ** 31 - 1
21     2147483648,  // 2 ** 31
22     255,         // 2 ** 8 - 1
23     256,         // 2 ** 8
24     65535,       // 2 ** 16 - 1
25     65536,       // 2 ** 16
26     4294967295,  // 2 ** 32 - 1
27     4294967296,  // 2 ** 32
28     9007199254740991, // 2 ** 53 - 1
29     9007199254740992, // 2 ** 53
30     1.1,
31     0.1,
32     0.5,
33     0.50000001,
34     0.6,
35     0.7,
36     undefined,
37     -1,
38     -0,
39     -0.1,
40     -1.1,
41     NaN,
42     -127,        // - ( 2 ** 7 - 1 )
43     -128,        // - ( 2 ** 7 )
44     -32767,      // - ( 2 ** 15 - 1 )
45     -32768,      // - ( 2 ** 15 )
46     -2147483647, // - ( 2 ** 31 - 1 )
47     -2147483648, // - ( 2 ** 31 )
48     -255,        // - ( 2 ** 8 - 1 )
49     -256,        // - ( 2 ** 8 )
50     -65535,      // - ( 2 ** 16 - 1 )
51     -65536,      // - ( 2 ** 16 )
52     -4294967295, // - ( 2 ** 32 - 1 )
53     -4294967296, // - ( 2 ** 32 )
54     Infinity,
55     -Infinity,
56     0
57   ],
59   expected: {
60     Int8: [
61       127,  // 127
62       -128, // 128
63       -1,   // 32767
64       0,    // 32768
65       -1,   // 2147483647
66       0,    // 2147483648
67       -1,   // 255
68       0,    // 256
69       -1,   // 65535
70       0,    // 65536
71       -1,   // 4294967295
72       0,    // 4294967296
73       -1,   // 9007199254740991
74       0,    // 9007199254740992
75       1,    // 1.1
76       0,    // 0.1
77       0,    // 0.5
78       0,    // 0.50000001,
79       0,    // 0.6
80       0,    // 0.7
81       0,    // undefined
82       -1,   // -1
83       0,    // -0
84       0,    // -0.1
85       -1,   // -1.1
86       0,    // NaN
87       -127, // -127
88       -128, // -128
89       1,    // -32767
90       0,    // -32768
91       1,    // -2147483647
92       0,    // -2147483648
93       1,    // -255
94       0,    // -256
95       1,    // -65535
96       0,    // -65536
97       1,    // -4294967295
98       0,    // -4294967296
99       0,    // Infinity
100       0,    // -Infinity
101       0
102     ],
103     Uint8: [
104       127, // 127
105       128, // 128
106       255, // 32767
107       0,   // 32768
108       255, // 2147483647
109       0,   // 2147483648
110       255, // 255
111       0,   // 256
112       255, // 65535
113       0,   // 65536
114       255, // 4294967295
115       0,   // 4294967296
116       255, // 9007199254740991
117       0,   // 9007199254740992
118       1,   // 1.1
119       0,   // 0.1
120       0,   // 0.5
121       0,   // 0.50000001,
122       0,   // 0.6
123       0,   // 0.7
124       0,   // undefined
125       255, // -1
126       0,   // -0
127       0,   // -0.1
128       255, // -1.1
129       0,   // NaN
130       129, // -127
131       128, // -128
132       1,   // -32767
133       0,   // -32768
134       1,   // -2147483647
135       0,   // -2147483648
136       1,   // -255
137       0,   // -256
138       1,   // -65535
139       0,   // -65536
140       1,   // -4294967295
141       0,   // -4294967296
142       0,   // Infinity
143       0,   // -Infinity
144       0
145     ],
146     Uint8Clamped: [
147       127, // 127
148       128, // 128
149       255, // 32767
150       255, // 32768
151       255, // 2147483647
152       255, // 2147483648
153       255, // 255
154       255, // 256
155       255, // 65535
156       255, // 65536
157       255, // 4294967295
158       255, // 4294967296
159       255, // 9007199254740991
160       255, // 9007199254740992
161       1,   // 1.1,
162       0,   // 0.1
163       0,   // 0.5
164       1,   // 0.50000001,
165       1,   // 0.6
166       1,   // 0.7
167       0,   // undefined
168       0,   // -1
169       0,   // -0
170       0,   // -0.1
171       0,   // -1.1
172       0,   // NaN
173       0,   // -127
174       0,   // -128
175       0,   // -32767
176       0,   // -32768
177       0,   // -2147483647
178       0,   // -2147483648
179       0,   // -255
180       0,   // -256
181       0,   // -65535
182       0,   // -65536
183       0,   // -4294967295
184       0,   // -4294967296
185       255, // Infinity
186       0,   // -Infinity
187       0
188     ],
189     Int16: [
190       127,    // 127
191       128,    // 128
192       32767,  // 32767
193       -32768, // 32768
194       -1,     // 2147483647
195       0,      // 2147483648
196       255,    // 255
197       256,    // 256
198       -1,     // 65535
199       0,      // 65536
200       -1,     // 4294967295
201       0,      // 4294967296
202       -1,     // 9007199254740991
203       0,      // 9007199254740992
204       1,      // 1.1
205       0,      // 0.1
206       0,      // 0.5
207       0,      // 0.50000001,
208       0,      // 0.6
209       0,      // 0.7
210       0,      // undefined
211       -1,     // -1
212       0,      // -0
213       0,      // -0.1
214       -1,     // -1.1
215       0,      // NaN
216       -127,   // -127
217       -128,   // -128
218       -32767, // -32767
219       -32768, // -32768
220       1,      // -2147483647
221       0,      // -2147483648
222       -255,   // -255
223       -256,   // -256
224       1,      // -65535
225       0,      // -65536
226       1,      // -4294967295
227       0,      // -4294967296
228       0,      // Infinity
229       0,      // -Infinity
230       0
231     ],
232     Uint16: [
233       127,   // 127
234       128,   // 128
235       32767, // 32767
236       32768, // 32768
237       65535, // 2147483647
238       0,     // 2147483648
239       255,   // 255
240       256,   // 256
241       65535, // 65535
242       0,     // 65536
243       65535, // 4294967295
244       0,     // 4294967296
245       65535, // 9007199254740991
246       0,     // 9007199254740992
247       1,     // 1.1
248       0,     // 0.1
249       0,     // 0.5
250       0,     // 0.50000001,
251       0,     // 0.6
252       0,     // 0.7
253       0,     // undefined
254       65535, // -1
255       0,     // -0
256       0,     // -0.1
257       65535, // -1.1
258       0,     // NaN
259       65409, // -127
260       65408, // -128
261       32769, // -32767
262       32768, // -32768
263       1,     // -2147483647
264       0,     // -2147483648
265       65281, // -255
266       65280, // -256
267       1,     // -65535
268       0,     // -65536
269       1,     // -4294967295
270       0,     // -4294967296
271       0,     // Infinity
272       0,     // -Infinity
273       0
274     ],
275     Int32: [
276       127,         // 127
277       128,         // 128
278       32767,       // 32767
279       32768,       // 32768
280       2147483647,  // 2147483647
281       -2147483648, // 2147483648
282       255,         // 255
283       256,         // 256
284       65535,       // 65535
285       65536,       // 65536
286       -1,          // 4294967295
287       0,           // 4294967296
288       -1,          // 9007199254740991
289       0,           // 9007199254740992
290       1,           // 1.1
291       0,           // 0.1
292       0,           // 0.5
293       0,           // 0.50000001,
294       0,           // 0.6
295       0,           // 0.7
296       0,           // undefined
297       -1,          // -1
298       0,           // -0
299       0,           // -0.1
300       -1,          // -1.1
301       0,           // NaN
302       -127,        // -127
303       -128,        // -128
304       -32767,      // -32767
305       -32768,      // -32768
306       -2147483647, // -2147483647
307       -2147483648, // -2147483648
308       -255,        // -255
309       -256,        // -256
310       -65535,      // -65535
311       -65536,      // -65536
312       1,           // -4294967295
313       0,           // -4294967296
314       0,           // Infinity
315       0,           // -Infinity
316       0
317     ],
318     Uint32: [
319       127,        // 127
320       128,        // 128
321       32767,      // 32767
322       32768,      // 32768
323       2147483647, // 2147483647
324       2147483648, // 2147483648
325       255,        // 255
326       256,        // 256
327       65535,      // 65535
328       65536,      // 65536
329       4294967295, // 4294967295
330       0,          // 4294967296
331       4294967295, // 9007199254740991
332       0,          // 9007199254740992
333       1,          // 1.1
334       0,          // 0.1
335       0,          // 0.5
336       0,          // 0.50000001,
337       0,          // 0.6
338       0,          // 0.7
339       0,          // undefined
340       4294967295, // -1
341       0,          // -0
342       0,          // -0.1
343       4294967295, // -1.1
344       0,          // NaN
345       4294967169, // -127
346       4294967168, // -128
347       4294934529, // -32767
348       4294934528, // -32768
349       2147483649, // -2147483647
350       2147483648, // -2147483648
351       4294967041, // -255
352       4294967040, // -256
353       4294901761, // -65535
354       4294901760, // -65536
355       1,          // -4294967295
356       0,          // -4294967296
357       0,          // Infinity
358       0,          // -Infinity
359       0
360     ],
361     Float16: [
362       127,                  // 127
363       128,                  // 128
364       32768,                // 32767
365       32768,                // 32768
366       Infinity,             // 2147483647
367       Infinity,             // 2147483648
368       255,                  // 255
369       256,                  // 256
370       Infinity,             // 65535
371       Infinity,             // 65536
372       Infinity,             // 4294967295
373       Infinity,             // 4294967296
374       Infinity,             // 9007199254740991
375       Infinity,             // 9007199254740992
376       1.099609375,          // 1.1
377       0.0999755859375,      // 0.1
378       0.5,                  // 0.5
379       0.5,                  // 0.50000001,
380       0.60009765625,        // 0.6
381       0.7001953125,         // 0.7
382       NaN,                  // undefined
383       -1,                   // -1
384       -0,                   // -0
385       -0.0999755859375,     // -0.1
386       -1.099609375,         // -1.1
387       NaN,                  // NaN
388       -127,                 // -127
389       -128,                 // -128
390       -32768,               // -32767
391       -32768,               // -32768
392       -Infinity,            // -2147483647
393       -Infinity,            // -2147483648
394       -255,                 // -255
395       -256,                 // -256
396       -Infinity,            // -65535
397       -Infinity,            // -65536
398       -Infinity,            // -4294967295
399       -Infinity,            // -4294967296
400       Infinity,             // Infinity
401       -Infinity,            // -Infinity
402       0
403     ],
404     Float32: [
405       127,                  // 127
406       128,                  // 128
407       32767,                // 32767
408       32768,                // 32768
409       2147483648,           // 2147483647
410       2147483648,           // 2147483648
411       255,                  // 255
412       256,                  // 256
413       65535,                // 65535
414       65536,                // 65536
415       4294967296,           // 4294967295
416       4294967296,           // 4294967296
417       9007199254740992,     // 9007199254740991
418       9007199254740992,     // 9007199254740992
419       1.100000023841858,    // 1.1
420       0.10000000149011612,  // 0.1
421       0.5,                  // 0.5
422       0.5,                  // 0.50000001,
423       0.6000000238418579,   // 0.6
424       0.699999988079071,    // 0.7
425       NaN,                  // undefined
426       -1,                   // -1
427       -0,                   // -0
428       -0.10000000149011612, // -0.1
429       -1.100000023841858,   // -1.1
430       NaN,                  // NaN
431       -127,                 // -127
432       -128,                 // -128
433       -32767,               // -32767
434       -32768,               // -32768
435       -2147483648,          // -2147483647
436       -2147483648,          // -2147483648
437       -255,                 // -255
438       -256,                 // -256
439       -65535,               // -65535
440       -65536,               // -65536
441       -4294967296,          // -4294967295
442       -4294967296,          // -4294967296
443       Infinity,             // Infinity
444       -Infinity,            // -Infinity
445       0
446     ],
447     Float64: [
448       127,         // 127
449       128,         // 128
450       32767,       // 32767
451       32768,       // 32768
452       2147483647,  // 2147483647
453       2147483648,  // 2147483648
454       255,         // 255
455       256,         // 256
456       65535,       // 65535
457       65536,       // 65536
458       4294967295,  // 4294967295
459       4294967296,  // 4294967296
460       9007199254740991, // 9007199254740991
461       9007199254740992, // 9007199254740992
462       1.1,         // 1.1
463       0.1,         // 0.1
464       0.5,         // 0.5
465       0.50000001,  // 0.50000001,
466       0.6,         // 0.6
467       0.7,         // 0.7
468       NaN,         // undefined
469       -1,          // -1
470       -0,          // -0
471       -0.1,        // -0.1
472       -1.1,        // -1.1
473       NaN,         // NaN
474       -127,        // -127
475       -128,        // -128
476       -32767,      // -32767
477       -32768,      // -32768
478       -2147483647, // -2147483647
479       -2147483648, // -2147483648
480       -255,        // -255
481       -256,        // -256
482       -65535,      // -65535
483       -65536,      // -65536
484       -4294967295, // -4294967295
485       -4294967296, // -4294967296
486       Infinity,    // Infinity
487       -Infinity,   // -Infinity
488       0
489     ]
490   }
493 // file: detachArrayBuffer.js
494 // Copyright (C) 2016 the V8 project authors.  All rights reserved.
495 // This code is governed by the BSD license found in the LICENSE file.
496 /*---
497 description: |
498     A function used in the process of asserting correctness of TypedArray objects.
500     $262.detachArrayBuffer is defined by a host.
501 defines: [$DETACHBUFFER]
502 ---*/
504 function $DETACHBUFFER(buffer) {
505   if (!$262 || typeof $262.detachArrayBuffer !== "function") {
506     throw new Test262Error("No method available to detach an ArrayBuffer");
507   }
508   $262.detachArrayBuffer(buffer);
511 // file: isConstructor.js
512 // Copyright (C) 2017 AndrĂ© Bargull. All rights reserved.
513 // This code is governed by the BSD license found in the LICENSE file.
515 /*---
516 description: |
517     Test if a given function is a constructor function.
518 defines: [isConstructor]
519 features: [Reflect.construct]
520 ---*/
522 function isConstructor(f) {
523     if (typeof f !== "function") {
524       throw new Test262Error("isConstructor invoked with a non-function value");
525     }
527     try {
528         Reflect.construct(function(){}, [], f);
529     } catch (e) {
530         return false;
531     }
532     return true;