summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/bug1351059.js
blob: c21595e6f3a93d1400cd8dddd698f5f0428e5257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// |jit-test| skip-if: !wasmDebuggingEnabled()

// Tests that onEnterFrame events are enabled when Debugger callbacks set
// before Instance creation.

load(libdir + "asserts.js");

var g = newGlobal({newCompartment: true});
g.parent = this;
g.onEnterFrameCalled = false;
g.eval(`
    var dbg = new Debugger(parent);
    dbg.onEnterFrame = frame => {
      onEnterFrameCalled = true;
    };
`);
var i = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(`
    (module (func (export "f")))
`)));
i.exports.f();

assertEq(g.onEnterFrameCalled, true);