chakra-core / chakra-core/ChakraCore
WScript.LoadModule inconsistencies
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
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
```js
WScript.LoadModule(``);
WScript.LoadModule(`//as`);
WScript.LoadModule(`const a = () -> {};`);
```
### Jshost.exe
- [ ] Assert, nullptr A/V when trying to load the same script twice
```js
WScript.LoadModule("");
WScript.LoadModule("");
```
- [ ] Doesn't support giving a filename as third argument for subsequent imports
```js
WScript.LoadModule(`export default 5;`, "self", "mod1.js");
WScript.LoadModule(`
import mod1 from "mod1.js";
console.log(\`First Module result: \${mod1}\`);
`);
```
Contributor guide
Assessment
This issue has not been assessed yet.