michael@0: // Debugger.Object.prototype.evalInGlobal argument validation michael@0: michael@0: load(libdir + 'asserts.js'); michael@0: michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger(); michael@0: var gw = dbg.addDebuggee(g); michael@0: var gobj = gw.makeDebuggeeValue(g.eval("({})")); michael@0: michael@0: assertThrowsInstanceOf(function () { gw.evalInGlobal(); }, TypeError); michael@0: assertThrowsInstanceOf(function () { gw.evalInGlobal(10); }, TypeError); michael@0: assertThrowsInstanceOf(function () { gobj.evalInGlobal('42'); }, TypeError); michael@0: assertEq(gw.evalInGlobal('42').return, 42); michael@0: michael@0: assertThrowsInstanceOf(function () { gw.evalInGlobalWithBindings(); }, TypeError); michael@0: assertThrowsInstanceOf(function () { gw.evalInGlobalWithBindings('42'); }, TypeError); michael@0: assertThrowsInstanceOf(function () { gw.evalInGlobalWithBindings(10, 1729); }, TypeError); michael@0: assertThrowsInstanceOf(function () { gw.evalInGlobalWithBindings('42', 1729); }, TypeError); michael@0: assertThrowsInstanceOf(function () { gobj.evalInGlobalWithBindings('42', {}); }, TypeError); michael@0: assertEq(gw.evalInGlobalWithBindings('42', {}).return, 42);