aboutsummaryrefslogtreecommitdiff
path: root/src/js/node/vm.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/node/vm.ts')
-rw-r--r--src/js/node/vm.ts40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/js/node/vm.ts b/src/js/node/vm.ts
index 331f4fbc6..e3058780a 100644
--- a/src/js/node/vm.ts
+++ b/src/js/node/vm.ts
@@ -1,5 +1,5 @@
// Hardcoded module "node:vm"
-import { throwNotImplemented } from "../shared";
+const { throwNotImplemented } = require("$shared");
const vm = $lazy("vm");
@@ -10,26 +10,31 @@ function runInContext(code, context, options) {
}
function compileFunction() {
- throwNotImplemented("node:vm compileFunction", 401);
+ throwNotImplemented("node:vm compileFunction");
}
function measureMemory() {
- throwNotImplemented("node:vm measureMemory", 401);
+ throwNotImplemented("node:vm measureMemory");
}
-const defaultObject = {
- createContext,
- runInContext,
- runInNewContext,
- runInThisContext,
- isContext,
- compileFunction,
- measureMemory,
- Script,
- [Symbol.for("CommonJS")]: 0,
-};
+class Module {
+ constructor() {
+ throwNotImplemented("node:vm Module");
+ }
+}
+
+class SourceTextModule {
+ constructor() {
+ throwNotImplemented("node:vm Module");
+ }
+}
+
+class SyntheticModule {
+ constructor() {
+ throwNotImplemented("node:vm Module");
+ }
+}
-export {
- defaultObject as default,
+export default {
createContext,
runInContext,
runInNewContext,
@@ -38,4 +43,7 @@ export {
compileFunction,
measureMemory,
Script,
+ Module,
+ SourceTextModule,
+ SyntheticModule,
};