Debian Codegraph @

js/src/jit-test/tests/bug1782558-veclen.js

raw
1 // |jit-test| skip-if: getBuildConfiguration("pointer-byte-size") > 4 || getBuildConfiguration("android")
2
3 // On 64-bit, this will allocate 2G temporary strings for keys while
4 // stringifying the Array, which takes a rather long time and doesn't have the
5 // potential of the problematic overflowing anyway.
6
7 try {
8 let x = [];
9 x.length = Math.pow(2, 32) - 1;
10 x + 1;
11 assertEq(true, false, "overflow expected");
12 } catch (e) {
13 assertEq((e + "").includes("InternalError: allocation size overflow"), true);
14 }