tor-browser

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

bug1956768.js (656B)


      1 let testModule = `(module
      2 (type $arrayMutI16 (array (mut i16)))
      3 
      4 (func $fromCharCodeArray
      5    (import "wasm:js-string" "fromCharCodeArray")
      6    (param (ref null $arrayMutI16) i32 i32)
      7    (result (ref extern)))
      8 
      9 (func (export "test") (result externref)
     10  (array.new_fixed $arrayMutI16 4 (i32.const 0) (i32.const 1) (i32.const 2) (i32.const 3))
     11  i32.const 0
     12  i32.const 4
     13  call $fromCharCodeArray
     14 )
     15 )`;
     16 let module = new WebAssembly.Module(wasmTextToBinary(testModule), {builtins: ['js-string']});
     17 let instance = new WebAssembly.Instance(module, {});
     18 
     19 oomTest(() => {
     20    let result = instance.exports.test();
     21    assertEq(result, "\x00\x01\x02\x03");
     22 });