tor-browser

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

bug1343579.js (816B)


      1 // |jit-test| test-also=--wasm-compiler=optimizing; skip-if: !wasmDebuggingEnabled()
      2 // Checking if Debugger.Script.isInCatchScope return false for wasm.
      3 
      4 load(libdir + "wasm.js");
      5 
      6 var results;
      7 wasmRunWithDebugger(
      8    '(module (memory 1) ' +
      9    '(func $func0 i32.const 1000000 i32.load drop) ' +
     10    '(func (export "test") call $func0))',
     11    undefined,
     12    function ({dbg, wasmScript}) {
     13        results = [];
     14        dbg.onExceptionUnwind = function (frame, value) {
     15            if (frame.type != 'wasmcall') return;
     16            var result = wasmScript.isInCatchScope(frame.offset);
     17            results.push(result);
     18        };
     19  },
     20  function ({error}) {
     21      assertEq(error !== undefined, true);
     22      assertEq(results.length, 2);
     23      assertEq(results[0], false);
     24      assertEq(results[1], false);
     25  }
     26 );