blob: 102b2d7dccf8819332af522acefe2f4b735ad100 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// |jit-test| --fast-warmup; --no-threads
// Inlining setters for SetElem ops will require bailout changes.
with ({}) { }
var trigger = false;
var obj = {
set f(x) {
if (trigger) {
bailout();
}
}
};
var sum = 0;
function foo(x) {
for (var i = 0; i < 35; i++) {
var t = obj[x] = i;
sum += t;
trigger = i % 10 == 0;
}
}
foo("f");
assertEq(sum, 595);
|