michael@0: // Debugger.prototype.findAllGlobals surface. michael@0: michael@0: load(libdir + 'asserts.js'); michael@0: michael@0: var dbg = new Debugger; michael@0: var d = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(dbg), 'findAllGlobals'); michael@0: assertEq(d.configurable, true); michael@0: assertEq(d.enumerable, false); michael@0: assertEq(d.writable, true); michael@0: assertEq(typeof d.value, 'function'); michael@0: assertEq(dbg.findAllGlobals.length, 0); michael@0: assertEq(dbg.findAllGlobals.name, 'findAllGlobals'); michael@0: michael@0: // findAllGlobals can only be applied to real Debugger instances. michael@0: assertThrowsInstanceOf(function() { michael@0: Debugger.prototype.findAllGlobals.call(Debugger.prototype); michael@0: }, michael@0: TypeError); michael@0: var a = dbg.findAllGlobals(); michael@0: assertEq(a instanceof Array, true); michael@0: assertEq(a.length > 0, true); michael@0: for (g of a) { michael@0: assertEq(g instanceof Debugger.Object, true); michael@0: }