Debian Codegraph @

js/src/jit-test/tests/auto-regress/bug1183241.js

raw
1 // |jit-test| error:TypeError
2 "use strict";
3
4 // Make it impossible to create a toSource() representation of |o|, because
5 // 100 * 2**22 exceeds the maximum string length.
6 var s = "a".repeat(2 ** 22);
7 var o = {};
8 for (var i = 0; i < 100; ++i) {
9 o["$" + i] = s;
10 }
11
12 Object.seal(o);
13
14 // Before the patch the toSource() represention was generated when an
15 // assignment failed in strict mode. And because it's not possible to create
16 // a toSource() representation for |o| (see above), this line caused an
17 // InternalError to be thrown. With the patch this line throws a TypeError.
18 o.foo = 0;