Debian Codegraph @

js/src/jit-test/tests/debug/Object-boundTargetFunction-02.js

raw
1 // Test that bound function accessors work on:
2 // - an ordinary non-bound function;
3 // - a native function;
4 // - and an object that isn't a function at all.
5
6 var g = newGlobal({newCompartment: true});
7 var dbg = new Debugger;
8 var gw = dbg.addDebuggee(g);
9 var fw = gw.executeInGlobal("function f() {}; f").return;
10 assertEq(fw.isBoundFunction, false);
11 assertEq(fw.boundThis, undefined);
12 assertEq(fw.boundArguments, undefined);
13 assertEq(fw.boundTargetFunction, undefined);
14
15 var nw = gw.executeInGlobal("var n = Math.max; n").return;
16 assertEq(nw.isBoundFunction, false);
17 assertEq(nw.boundThis, undefined);
18 assertEq(fw.boundArguments, undefined);
19 assertEq(nw.boundTargetFunction, undefined);
20
21 var ow = gw.executeInGlobal("var o = {}; o").return;
22 assertEq(ow.isBoundFunction, false);
23 assertEq(ow.boundThis, undefined);
24 assertEq(fw.boundArguments, undefined);
25 assertEq(ow.boundTargetFunction, undefined);