summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/pic/proto1.js
blob: 4c98dd7da0c8667dd41849d737d994b84bfceb9c (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
// getprop, proto, 1 shape

var expected = "11,22,33,11,22,33,11,22,33,11,22,33,11,22,33,";
var actual = '';

var proto = { a: 11, b: 22, c: 33 };

function B() {
}
B.prototype = proto;

function f() {
  var o = new B();
  
  for (var i = 0; i < 5; ++i) {
    actual += o.a + ',';
    actual += o.b + ',';
    actual += o.c + ',';
  }
}

f();

assertEq(actual, expected);