Debian Codegraph @

js/src/jit-test/tests/ion/typedarrayindex-const-double-representable-as-int32.js

raw
1 function f(n) {
2 const ta = new Int32Array(n);
3
4 // When the TypedArray has a zero length, accessing the element at index 0
5 // should return undefined. That'll lead to using MGuardNumberToIntPtrIndex
6 // with supportOOB for the TypedArray index conversion.
7 const r = n === 0 ? undefined : 0;
8
9 // numberToDouble always returns a double number.
10 const k = numberToDouble(0);
11
12 for (var i = 0; i < 10; ++i) {
13 assertEq(ta[k], r);
14 }
15 }
16
17 for (var i = 0; i < 2; ++i) {
18 f(i);
19 }