tor-browser

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

eval-module-oom.js (410B)


      1 // OOM tests for module parsing.
      2 
      3 const sa =
      4 `export default 20;
      5 export let a = 22;
      6 export function f(x, y) { return x + y }
      7 `;
      8 
      9 const sb =
     10 `import x from "a";
     11 import { a as y } from "a";
     12 import * as ns from "a";
     13 ns.f(x, y);
     14 `;
     15 
     16 oomTest(() => {
     17    let a = registerModule('a', parseModule(sa));
     18    let b = registerModule('b', parseModule(sb));
     19    moduleLink(b);
     20    assertEq(moduleEvaluate(b), 42);
     21 });