Debian Codegraph @

js/src/jit-test/tests/fuses/regexp-1.js

raw
1 // Mutating certain properties pops the fuse. Changing the enumerable attribute is fine.
2 function testProp(propName) {
3 newGlobal().evaluate(`
4 assertEq(getFuseState().OptimizeRegExpPrototypeFuse.intact, true);
5 Object.defineProperty(RegExp.prototype, ${propName}, {enumerable: true});
6 assertEq(getFuseState().OptimizeRegExpPrototypeFuse.intact, true);
7 Object.defineProperty(RegExp.prototype, ${propName}, {value:null});
8 assertEq(getFuseState().OptimizeRegExpPrototypeFuse.intact, false);
9 `);
10 }
11
12 // Getters.
13 testProp(`"flags"`);
14 testProp(`"global"`);
15 testProp(`"hasIndices"`);
16 testProp(`"ignoreCase"`);
17 testProp(`"multiline"`);
18 testProp(`"sticky"`);
19 testProp(`"unicode"`);
20 testProp(`"unicodeSets"`);
21 testProp(`"dotAll"`);
22
23 // Data properties.
24 testProp(`"exec"`);
25 testProp(`Symbol.match`);
26 testProp(`Symbol.matchAll`);
27 testProp(`Symbol.replace`);
28 testProp(`Symbol.search`);
29 testProp(`Symbol.split`);