PageRenderTime 16ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/jit-test/tests/arguments/nonstrict-args.js

http://github.com/zpao/v8monkey
JavaScript | 24 lines | 15 code | 5 blank | 4 comment | 1 complexity | 5fabc840b53ebdc50ceb842f36567668 MD5 | raw file
 1/*
 2 * Any copyright is dedicated to the Public Domain.
 3 * http://creativecommons.org/licenses/publicdomain/
 4 */
 5load(libdir + 'array-compare.js');
 6
 7var obj = {};
 8
 9function args(a) { return arguments; }
10
11var a1, a2, a3, a4;
12
13for (var i = 0; i < 5; i++)
14{
15  a1 = args();
16  a2 = args(1);
17  a3 = args(1, obj);
18  a4 = args("foopy");
19}
20
21assertEq(arraysEqual(a1, []), true);
22assertEq(arraysEqual(a2, [1]), true);
23assertEq(arraysEqual(a3, [1, obj]), true);
24assertEq(arraysEqual(a4, ["foopy"]), true);