1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
function testLengthOnNonNativeProto() { var o = {}; o.__proto__ = [3]; for (var j = 0; j < 5; j++) o[0]; var o2 = {}; o2.__proto__ = []; for (var j = 0; j < 5; j++) o2.length; function foo() { } foo.__proto__ = []; for (var j = 0; j < 5; j++) foo.length; return "no assertion"; } assertEq(testLengthOnNonNativeProto(), "no assertion");