summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testLengthOnNonNativeProto.js
blob: 80d388f8dde0f2e9582c64f2c801beb7b8c925f1 (plain)
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");