|
1 // Debugger.prototype.findAllGlobals surface. |
|
2 |
|
3 load(libdir + 'asserts.js'); |
|
4 |
|
5 var dbg = new Debugger; |
|
6 var d = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(dbg), 'findAllGlobals'); |
|
7 assertEq(d.configurable, true); |
|
8 assertEq(d.enumerable, false); |
|
9 assertEq(d.writable, true); |
|
10 assertEq(typeof d.value, 'function'); |
|
11 assertEq(dbg.findAllGlobals.length, 0); |
|
12 assertEq(dbg.findAllGlobals.name, 'findAllGlobals'); |
|
13 |
|
14 // findAllGlobals can only be applied to real Debugger instances. |
|
15 assertThrowsInstanceOf(function() { |
|
16 Debugger.prototype.findAllGlobals.call(Debugger.prototype); |
|
17 }, |
|
18 TypeError); |
|
19 var a = dbg.findAllGlobals(); |
|
20 assertEq(a instanceof Array, true); |
|
21 assertEq(a.length > 0, true); |
|
22 for (g of a) { |
|
23 assertEq(g instanceof Debugger.Object, true); |
|
24 } |