Debian Codegraph @

js/src/jit-test/tests/fuses/string-proto-symbols-3.js

raw
1 // |jit-test| --fast-warmup; --no-threads
2
3 // Test invalidation of Ion code when StringPrototypeSymbols fuse is popped.
4 function test() {
5 var s = "foobar";
6 var count = 0;
7 for (var i = 0; i < 200; i++) {
8 s.replace("abc", "").replace("def", "");
9 if (i === 150) {
10 // Pop the fuse.
11 Object.prototype[Symbol.replace] = function() {
12 count++;
13 return s;
14 };
15 }
16 }
17 assertEq(count, 98);
18 }
19 test();