js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-11.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-11.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +// Resumption values other than |undefined| from uncaughtExceptionHook from
     1.5 +// onNewGlobalObject handlers are ignored (other than cancelling further hooks).
     1.6 +
     1.7 +load(libdir + 'asserts.js');
     1.8 +
     1.9 +var dbg = new Debugger;
    1.10 +var log;
    1.11 +
    1.12 +dbg.onNewGlobalObject = function () {
    1.13 +  log += 'n';
    1.14 +  throw 'party';
    1.15 +};
    1.16 +
    1.17 +dbg.uncaughtExceptionHook = function (ex) {
    1.18 +  log += 'u';
    1.19 +  assertEq(ex, 'party');
    1.20 +  return { throw: 'fit' };
    1.21 +};
    1.22 +
    1.23 +log = '';
    1.24 +assertEq(typeof newGlobal(), 'object');
    1.25 +assertEq(log, 'nu');
    1.26 +
    1.27 +dbg.uncaughtExceptionHook = function (ex) {
    1.28 +  log += 'u';
    1.29 +  assertEq(ex, 'party');
    1.30 +};
    1.31 +
    1.32 +log = '';
    1.33 +assertEq(typeof newGlobal(), 'object');
    1.34 +assertEq(log, 'nu');

mercurial