/js/src/jit-test/tests/basic/newTest.js
http://github.com/zpao/v8monkey · JavaScript · 14 lines · 13 code · 1 blank · 0 comment · 1 complexity · 8b31cc29e594b034feb32def436b916a MD5 · raw file
- 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");