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

/js/src/jit-test/tests/jaeger/inline/scripted-03.js

http://github.com/zpao/v8monkey
JavaScript | 14 lines | 12 code | 2 blank | 0 comment | 1 complexity | 855d8dec96b78207661d127cf0d6ac19 MD5 | raw file
 1function choose(x, y, z) {
 2  return x ? y : z;
 3}
 4
 5function foo(x, y, z) {
 6  var a = 0;
 7  for (var i = 0; i < 100; i++) {
 8    a += choose(x, y, z);
 9  }
10  return a;
11}
12
13var q = foo(true, 10, 0);
14assertEq(q, 1000);