michael@0: // Globals passed to onNewGlobalObject handers are ready for use immediately. michael@0: michael@0: var dbg = new Debugger; michael@0: var log = ''; michael@0: dbg.onNewGlobalObject = function (global) { michael@0: log += 'n'; michael@0: var gw = dbg.addDebuggee(global); michael@0: gw.defineProperty('x', { value: -1 }); michael@0: // Check that the global's magic lazy properties are working. michael@0: assertEq(gw.evalInGlobalWithBindings('Math.atan2(y,x)', { y: 0 }).return, Math.PI); michael@0: // Check that the global's prototype is hooked up. michael@0: assertEq(gw.evalInGlobalWithBindings('x.toString()', { x: gw }).return, "[object global]"); michael@0: }; michael@0: michael@0: newGlobal(); michael@0: michael@0: assertEq(log, 'n');