summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/newTest.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/newTest.js')
-rw-r--r--js/src/jit-test/tests/basic/newTest.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/newTest.js b/js/src/jit-test/tests/basic/newTest.js
new file mode 100644
index 000000000..5defbe9f2
--- /dev/null
+++ b/js/src/jit-test/tests/basic/newTest.js
@@ -0,0 +1,14 @@
+function MyConstructor(i)
+{
+ this.i = i;
+}
+MyConstructor.prototype.toString = function() {return this.i + ""};
+
+function newTest()
+{
+ var a = [];
+ for (var i = 0; i < 10; i++)
+ a[i] = new MyConstructor(i);
+ return a.join("");
+}
+assertEq(newTest(), "0123456789");