~ubuntu-branches/ubuntu/trusty/mozjs24/trusty-proposed

« back to all changes in this revision

Viewing changes to js/src/jit-test/tests/debug/Frame-onPop-12.js

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2014-02-11 21:55:34 UTC
  • Revision ID: package-import@ubuntu.com-20140211215534-m1zyq5aj59md3y07
Tags: upstream-24.2.0
ImportĀ upstreamĀ versionĀ 24.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Setting an onPop handler from an onPop handler doesn't throw, but the
 
2
// new handler doesn't fire.
 
3
var g = newGlobal('new-compartment');
 
4
var dbg = new Debugger(g);
 
5
var log;
 
6
 
 
7
dbg.onDebuggerStatement = function handleDebugger(frame) {
 
8
    log += 'd';
 
9
    assertEq(frame.type, "eval");
 
10
    frame.onPop = function firstHandlePop(c) {
 
11
        log +=')';
 
12
        assertEq(c.return, 'on investment');
 
13
        this.onPop = function secondHandlePop(c) {
 
14
            assertEq("secondHandlePop was called", "secondHandlePop should never be called");
 
15
        };
 
16
    };
 
17
};
 
18
 
 
19
log = "";
 
20
g.eval("debugger; 'on investment';");
 
21
assertEq(log, 'd)');