Debian Codegraph @

js/src/jit-test/tests/basic/bug1827072.js

raw
1 assertThrows(() => newString("", { capacity: 1 }));
2 assertThrows(() => newString("x", { capacity: 2 }));
3
4 // Too large for an inline string.
5 const nonInlineLinear = "123456789012345678901234567890";
6 assertEq(nonInlineLinear.length, 30);
7
8 newString(nonInlineLinear, { capacity: 29, tenured: true });
9 newString(nonInlineLinear, { capacity: 30, tenured: true });
10 newString(nonInlineLinear, { capacity: 31, tenured: true });
11
12 function assertThrows(f) {
13 try {
14 f();
15 } catch {
16 return;
17 }
18 throw new Error("missing error");
19 }