Skip to content

WScript.LoadModule inconsistencies #3356

@Cellule

Description

@Cellule

I am encountering a lot of problems when trying to use WScript.LoadModule, mostly due to very different behavior between jshost and ch.

ch.exe

  • Memory leak on Syntax error with multiple modules
WScript.LoadModule(``);
WScript.LoadModule(`//as`);
WScript.LoadModule(`const a = () -> {};`);

Jshost.exe

  • Assert, nullptr A/V when trying to load the same script twice
WScript.LoadModule("");
WScript.LoadModule("");
  • Doesn't support giving a filename as third argument for subsequent imports
WScript.LoadModule(`export default 5;`, "self", "mod1.js");
WScript.LoadModule(`
import mod1 from "mod1.js";
console.log(\`First Module result: \${mod1}\`);
`);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions