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

/js/src/jit-test/tests/basic/testLengthInString.js

http://github.com/zpao/v8monkey
JavaScript | 12 lines | 12 code | 0 blank | 0 comment | 5 complexity | faacb30c1e18926beec56703a8917fa2 MD5 | raw file
 1function testLengthInString()
 2{
 3  var s = new String();
 4  var res = "length" in s;
 5  for (var i = 0; i < 5; i++)
 6    res = res && ("length" in s);
 7  res = res && s.hasOwnProperty("length");
 8  for (var i = 0; i < 5; i++)
 9    res = res && s.hasOwnProperty("length");
10  return res;
11}
12assertEq(testLengthInString(), true);