PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/js/src/jit-test/tests/debug/Frame-eval-09.js

http://github.com/zpao/v8monkey
JavaScript | 20 lines | 16 code | 3 blank | 1 comment | 0 complexity | 061ed1c33a43b0914e8da9fdf9fc5f77 MD5 | raw file
 1// assigning to local variables in frame.eval code
 2
 3var g = newGlobal('new-compartment');
 4var dbg = new Debugger(g);
 5dbg.onDebuggerStatement = function (frame) {
 6    frame.eval("outerarg = 1; outervar = 2; innerarg = 3; innervar = 4;");
 7};
 8
 9var result = g.eval("(" + function outer(outerarg) {
10        var outervar = 200;
11        function inner(innerarg) {
12            var innervar = 400;
13            debugger;
14            return innerarg + innervar;
15        }
16        var innersum = inner(300);
17        return outerarg + outervar + innersum;
18    } + ")(100)");
19
20assertEq(result, 10);