javascript 0.3.0

A JavaScript engine implementation in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(async function() {
  try {
    const promise = import("./dynamic-import-target.js");
    if (!promise || typeof promise.then !== "function") {
      throw new Error("import did not return a promise");
    }
    const mod = await promise;
    // console.log(mod && mod.ok === true ? "OK" : "NO");
    if (mod && mod.ok === true) {
      console.log("OK");
    } else {
      throw new Error("Module did not have expected export");
    }
  } catch (e) {
    console.log("NO. reason: " + e);
  }
})();