blob: 735504cf8944513ae9c947771efaecb1c4eeab71 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
var src = `
var p = {y: 1};
var arr = [];
for (var i = 0; i < 10; i++) {
var o = Object.create(p);
o["x" + i] = 2;
arr.push(o);
}
arr
`;
var wrapper = evaluate(src, {global: newGlobal({sameZoneAs: this})});
for (var i = 0; i < 50; i++) {
assertEq(wrapper[i % 10].y, 1);
}
|