Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / jit-test / tests / basic / testLambdaCtor.js
1 function testLambdaCtor() {
2     var a = [];
3     for (var x = 0; x < RUNLOOP; ++x) {
4         var f = function(){};
5         a[a.length] = new f;
6     }
7
8     // This prints false until the upvar2 bug is fixed:
9     // print(a[HOTLOOP].__proto__ !== a[HOTLOOP-1].__proto__);
10
11     // Assert that the last f was properly constructed.
12     return a[RUNLOOP-1].__proto__ === f.prototype;
13 }
14 assertEq(testLambdaCtor(), true);