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

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

mercurial