summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/class/methDefn.js
blob: f8a6d883a470c6a54bbfa66263068917b5ab86ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
load(libdir + "asserts.js");

function f(tag) { return {[tag](){return 1;}}; }
a = [];
for (var i = 0; i < 2000; i++)
    a[i] = f("first");

for (var i = 0; i < 2000; i++)
    assertEq(a[i].first(), 1);

for (var i = 0; i < 2000; i++)
    a[i] = f("second");

for (var i = 0; i < 2000; i++)
    assertEq(a[i].second(), 1);