diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-14.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-14.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,17 @@ +// Globals passed to onNewGlobalObject handers are ready for use immediately. + +var dbg = new Debugger; +var log = ''; +dbg.onNewGlobalObject = function (global) { + log += 'n'; + var gw = dbg.addDebuggee(global); + gw.defineProperty('x', { value: -1 }); + // Check that the global's magic lazy properties are working. + assertEq(gw.evalInGlobalWithBindings('Math.atan2(y,x)', { y: 0 }).return, Math.PI); + // Check that the global's prototype is hooked up. + assertEq(gw.evalInGlobalWithBindings('x.toString()', { x: gw }).return, "[object global]"); +}; + +newGlobal(); + +assertEq(log, 'n');