summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onNativeCall-08.js
blob: a47a73747aa52e7f3196be37510d846cf99da45f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Test that the onNativeCall hook is called when native function is
// called inside self-hosted JS as part of iteration.

load(libdir + 'eqArrayHelper.js');

var g = newGlobal({ newCompartment: true });
var dbg = new Debugger();
var gdbg = dbg.addDebuggee(g);

const rv = [];
dbg.onNativeCall = (callee, reason) => {
  rv.push(callee.name);
};

gdbg.executeInGlobal(`
Array.from([1, 2, 3]);
`);
assertEqArray(rv, [
  "from",
  "values",
  "next", "next", "next", "next",
]);