tor-browser

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

module-exports.js (523B)


      1 const count = 10;
      2 
      3 let s = "";
      4 for (let i = 0; i < count; i++)
      5    s += "export let e" + i + " = " + (i * i) + ";\n";
      6 let stencil = compileToStencilXDR(s, {module: true});
      7 let m = instantiateModuleStencilXDR(stencil);
      8 let a = registerModule('a', m);
      9 
     10 stencil = compileToStencilXDR("import * as ns from 'a'", {module: true});
     11 m = instantiateModuleStencilXDR(stencil);
     12 let b = registerModule('b', m);
     13 
     14 moduleLink(b);
     15 moduleEvaluate(b);
     16 
     17 let ns = a.namespace;
     18 for (let i = 0; i < count; i++)
     19    assertEq(ns["e" + i], i * i);