summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/new-1.js
blob: 81862b562f9e1c44e7c4b2bcb49e5432beba748a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Some testing for JSOP_NEW.
function foo(prop) {
	this.name = "Foo";
	this.prop = prop;
}

// Construct an object with a unique assignation to a property.
function f(i) {
	var x = new foo(i);
	return x.prop;
}

// Assert that a unique object really was created.
for (var i = 0; i < 100; i++)
	assertEq(f(i), i);