blob: 6982b26d2d400fd96dd7059b9d556f072443d397 (
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
27
28
29
30
|
function bar(o, trigger) {
with ({}) {}
if (trigger) {
Object.defineProperty(o, "y", {
get() { return 3; }
});
}
}
function foo(o, trigger) {
var result;
for (var key in o) {
result = o[key];
bar(o, trigger);
}
return result;
}
var arr = [];
for (var i = 0; i < 10; i++) {
arr.push({["x" + i]: 0, y: 0});
}
with ({}) {}
for (var i = 0; i < 1000; i++) {
for (var o of arr) {
foo(o, false)
}
}
print(foo(arr[0], true));
|