1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/ion/new-2.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,13 @@ 1.4 +// Test JSOP_NEW using native constructors. 1.5 +// Construct an object with a unique assignation to a property. 1.6 +function f(i) { 1.7 + var x = new Number(i); 1.8 + return x; 1.9 +} 1.10 + 1.11 +// Assert that a unique object really was created. 1.12 +for (var i = 0; i < 100; i++) { 1.13 + var o = f(i); 1.14 + assertEq(typeof o, "object"); 1.15 + assertEq(Number(o), i); 1.16 +}