tor-browser

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

bug1865044.js (893B)


      1 // |jit-test| --more-compartments; skip-variant-if: --setpref=wasm_test_serialization=true, true; skip-variant-if: --wasm-compiler=ion, true; skip-if: !('Function' in WebAssembly)
      2 
      3 a = newGlobal();
      4 a.b = this;
      5 a.eval("(" + function () {
      6    Debugger(b).onExceptionUnwind = function () {}
      7 } + ")()");
      8 function c(d) {
      9  binary = wasmTextToBinary(d)
     10  e = new WebAssembly.Module(binary)
     11  return new WebAssembly.Instance(e)
     12 }
     13 f = c(`
     14 (type $g 
     15  (func (param i64 i64 funcref) (result i64))
     16 )          
     17 (func (export "vis") (param i64 i64 funcref) (result i64) 
     18  local.get 0 
     19  local.get 1
     20  local.get 2
     21  local.get 2
     22  ref.cast (ref $g)
     23  return_call_ref $g
     24 )
     25 `);
     26 h = f.exports["vis"];
     27 i = new WebAssembly.Function({
     28  parameters: [ "i64", "i64", "funcref" ], results: ["i64"]   
     29 }, function () {});
     30 
     31 assertErrorMessage(
     32  () => h(3n, 1n, i),
     33  TypeError, /can't convert undefined to BigInt/
     34 );