Invalid flags in a RegExp literal should be an early SyntaxError
[WebKit-https.git] / JSTests / stress / domjit-getter.js
1 var createDOMJITGetterObject = $vm.createDOMJITGetterObject;
2
3 function shouldBe(actual, expected) {
4     if (actual !== expected)
5         throw new Error(`bad value: ${String(actual)}`);
6 }
7
8 var domjit = createDOMJITGetterObject();
9
10 function access(domjit)
11 {
12     return domjit.customGetter + domjit.customGetter;
13 }
14
15 for (var i = 0; i < 1e4; ++i)
16     shouldBe(access(domjit), 84);
17
18 shouldBe(access({ customGetter: 42 }), 84);
19 domjit.test = 44;
20 shouldBe(access(domjit), 84);