~ubuntu-branches/ubuntu/saucy/mozjs17/saucy-proposed

« back to all changes in this revision

Viewing changes to js/src/jit-test/tests/debug/Environment-setVariable-05.js

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// setVariable can change the types of variables and arguments in functions.
 
2
 
 
3
var g = newGlobal('new-compartment');
 
4
g.eval("function f(a) { var b = a + 1; debugger; return a + b; }");
 
5
for (var i = 0; i < 20; i++)
 
6
    assertEq(g.f(i), 2 * i + 1);
 
7
 
 
8
var dbg = new Debugger(g);
 
9
dbg.onDebuggerStatement = function (frame) {
 
10
    frame.environment.setVariable("a", "xyz");
 
11
    frame.environment.setVariable("b", "zy");
 
12
};
 
13
for (var i = 0; i < 10; i++)
 
14
    assertEq(g.f(i), "xyzzy");