PageRenderTime 21ms CodeModel.GetById 11ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/jit-test/tests/debug/Object-parameterNames.js

http://github.com/zpao/v8monkey
JavaScript | 33 lines | 31 code | 2 blank | 0 comment | 0 complexity | b269730e0ddac43593f7b677dacf715d MD5 | raw file
 1load(libdir + 'array-compare.js');
 2
 3var g = newGlobal('new-compartment');
 4var dbg = new Debugger(g);
 5var hits = 0;
 6dbg.onDebuggerStatement = function (frame) {
 7    var arr = frame.arguments;
 8    assertEq(arraysEqual(arr[0].parameterNames, []), true);
 9    assertEq(arraysEqual(arr[1].parameterNames, ["x"]), true);
10    assertEq(arraysEqual(arr[2].parameterNames,
11                         ["a","b","c","d","e","f","g","h","i","j","k","l","m",
12                          "n","o","p","q","r","s","t","u","v","w","x","y","z"]), 
13             true);
14    assertEq(arraysEqual(arr[3].parameterNames, ["a", (void 0), (void 0)]), true);
15    assertEq(arr[4].parameterNames, (void 0));
16    assertEq(arraysEqual(arr[5].parameterNames, [(void 0), (void 0)]), true);
17    assertEq(arr.length, 6);
18    hits++;
19};
20
21g.eval("("
22       + function () { 
23           (function () { debugger; }
24            (function () {},
25             function (x) {},
26             function (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) {},
27             function (a, [b, c], {d, e:f}) { },
28             {a:1},
29             Math.atan2
30            ));
31       }
32       +")()");
33assertEq(hits, 1);