PageRenderTime 18ms CodeModel.GetById 10ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/jit-test/tests/jaeger/recompile/property.js

http://github.com/zpao/v8monkey
JavaScript | 26 lines | 22 code | 3 blank | 1 comment | 3 complexity | 2526b7c2697e9ddff5a416e18b5ddbaa MD5 | raw file
 1
 2/* Handle recompilation on undefined properties and array holes. */
 3
 4var v = {};
 5if (typeof v == 'string')
 6  v.x = 0;
 7function prop(v)
 8{
 9  var z = v.x + 1;
10  assertEq(z, NaN);
11}
12prop(v);
13
14v = [];
15v[0] = 0;
16v[1] = 1;
17v[3] = 3;
18v[4] = 4;
19function elem(x)
20{
21  var x = "";
22  for (var i = 0; i < 5; i++)
23    x += v[i];
24  assertEq(x, "01undefined34");
25}
26elem(v);