PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1function MyConstructor(i)
 2{
 3  this.i = i;
 4}
 5MyConstructor.prototype.toString = function() {return this.i + ""};
 6
 7function newTest()
 8{
 9  var a = [];
10  for (var i = 0; i < 10; i++)
11    a[i] = new MyConstructor(i);
12  return a.join("");
13}
14assertEq(newTest(), "0123456789");