tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

bug1331592.js (736B)


      1 // |jit-test| test-also=--wasm-compiler=optimizing; error: TestComplete
      2 
      3 if (!wasmDebuggingEnabled())
      4     throw "TestComplete";
      5 
      6 var module = new WebAssembly.Module(wasmTextToBinary(`
      7    (module
      8        (import "global" "func" (func (result i32)))
      9        (func (export "func_0") (result i32)
     10         call 0 ;; calls the import, which is func #0
     11        )
     12    )
     13 `));
     14 
     15 var dbg;
     16 (function (global) {
     17    var dbgGlobal = newGlobal({newCompartment: true});
     18    dbg = new dbgGlobal.Debugger();
     19    dbg.addDebuggee(global);
     20 })(this);
     21 
     22 var instance = new WebAssembly.Instance(module, { global: { func: () => {
     23    var frame = dbg.getNewestFrame().older;
     24    frame.eval("some_error");
     25 }}});
     26 instance.exports.func_0();
     27 
     28 throw "TestComplete";