js/src/jit-test/tests/ion/new-1.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:d711dfdb41d1
1 // Some testing for JSOP_NEW.
2 function foo(prop) {
3 this.name = "Foo";
4 this.prop = prop;
5 }
6
7 // Construct an object with a unique assignation to a property.
8 function f(i) {
9 var x = new foo(i);
10 return x.prop;
11 }
12
13 // Assert that a unique object really was created.
14 for (var i = 0; i < 100; i++)
15 assertEq(f(i), i);

mercurial