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

/js/src/jit-test/tests/arguments/strict-args-flushstack.js

http://github.com/zpao/v8monkey
JavaScript | 27 lines | 18 code | 5 blank | 4 comment | 1 complexity | ea72294049d6d131088ad00dfd744c07 MD5 | raw file
 1/*
 2 * Any copyright is dedicated to the Public Domain.
 3 * http://creativecommons.org/licenses/publicdomain/
 4 */
 5var args;
 6
 7function test()
 8{
 9  "use strict";
10  eval("args = arguments;");
11  var a = [];
12  for (var i = 0; i < 9; i++)
13    a.push(arguments);
14  return a;
15}
16
17var a = test();
18
19assertEq(Array.isArray(a), true);
20assertEq(a.length, 9);
21
22var count = 0;
23a.forEach(function(v, i) { count++; assertEq(v, args); });
24assertEq(count, 9);
25
26assertEq(Object.prototype.toString.call(args), "[object Arguments]");
27assertEq(args.length, 0);