tor-browser

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

exports.tentative.any.js (1029B)


      1 // META: global=window,dedicatedworker,jsshell,shadowrealm
      2 
      3 "use strict";
      4 
      5 promise_test(async () => {
      6  const mod = await import("./resources/exports.wasm");
      7 
      8  assert_array_equals(Object.getOwnPropertyNames(mod).sort(), [
      9    "a\u200Bb\u0300c",
     10    "func",
     11    "glob",
     12    "mem",
     13    "tab",
     14    "value with spaces",
     15    "🎯test-func!",
     16  ]);
     17  assert_true(mod.func instanceof Function);
     18  assert_true(mod.mem instanceof WebAssembly.Memory);
     19  assert_true(mod.tab instanceof WebAssembly.Table);
     20 
     21  assert_false(mod.glob instanceof WebAssembly.Global);
     22  assert_equals(typeof mod.glob, "number");
     23 
     24  assert_throws_js(TypeError, () => {
     25    mod.func = 2;
     26  });
     27 
     28  assert_equals(typeof mod["value with spaces"], "number");
     29  assert_equals(mod["value with spaces"], 123);
     30 
     31  assert_true(mod["🎯test-func!"] instanceof Function);
     32  assert_equals(mod["🎯test-func!"](), 456);
     33 
     34  assert_equals(typeof mod["a\u200Bb\u0300c"], "number");
     35  assert_equals(mod["a\u200Bb\u0300c"], 789);
     36 }, "Exported names from a WebAssembly module");