summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/new-7.js
blob: 73f059c24d47fc7d7daff710f0a6368e0581fb44 (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
25
26
27
28
29
30
31
32
// Reduced from v8-raytrace.

var Class = {
	create : function() {
		return function() {
			this.initialize.apply(this, arguments);
		}
	}
}

var Bar = Class.create();
Bar.prototype = {
	// Compiled third.
	initialize : function() { }
}

var Foo = Class.create();
Foo.prototype = {
	// Compiled second. Crashes when setting "bar". Uses LCallConstructor.
	initialize : function() {
		this.bar = new Bar();
	}
}

// Compiled first.
function f() {
	for (var i = 0; i < 100; i++) {
		var foo = new Foo();
	}
}

f();