summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onNewScript-off-main-thread-01.js
blob: c88e4e04027417fe652360e6842914ba59e2bb5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// |jit-test| skip-if: helperThreadCount() === 0

// We still get onNewScript notifications for code compiled off the main thread.

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

var log;
dbg.onNewScript = function (s) {
  log += 's';
  assertEq(s.source.text, '"t" + "wine"');
}

log = '';
g.offThreadCompileScript('"t" + "wine"');
assertEq(g.runOffThreadScript(), 'twine');
assertEq(log, 's');