Skip to content

Commit

Permalink
fix(ext/node): add vm.constants (#25630)
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy authored Sep 15, 2024
1 parent 4655172 commit db6fc12
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ext/node/polyfills/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts";

import { primordials } from "ext:core/mod.js";

const { Symbol, ArrayPrototypeForEach } = primordials;
const { Symbol, ArrayPrototypeForEach, ObjectFreeze } = primordials;

const kParsingContext = Symbol("script parsing context");

Expand Down Expand Up @@ -349,8 +349,22 @@ export function measureMemory(_options) {
notImplemented("measureMemory");
}

const USE_MAIN_CONTEXT_DEFAULT_LOADER = Symbol(
"USE_MAIN_CONTEXT_DEFAULT_LOADER",
);
const DONT_CONTEXTIFY = Symbol("DONT_CONTEXTIFY");

export const constants = {
__proto__: null,
USE_MAIN_CONTEXT_DEFAULT_LOADER,
DONT_CONTEXTIFY,
};

ObjectFreeze(constants);

export default {
Script,
constants,
createContext,
createScript,
runInContext,
Expand Down

0 comments on commit db6fc12

Please # to comment.