blob: 351f8f676316707228bff32f5359682f021f18ef (
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
|
function f() {
var x = [1, 2, 3];
var y = {};
x.__proto__ = y;
for (var i = 0; i < 200; i++) {
if (i == 100)
y[100000] = 15;
else
assertEq(typeof x[100000], i > 100 ? "number" : "undefined");
}
}
function g() {
var x = [1, 2, 3];
var y = {};
x.__proto__ = y;
for (var i = 0; i < 200; i++) {
if (i == 100)
y[4] = 15;
else
assertEq(typeof x[4], i > 100 ? "number" : "undefined");
}
}
f();
g();
|