summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/vm.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2024-09-06 19:52:59 +0900
committerGitHub <noreply@github.com>2024-09-06 12:52:59 +0200
commitf0a3d206422af3177e0f36ed22802c1ccc6f7654 (patch)
tree57ad718cc47b7b98c0bbd869d6c070adee3bf30a /ext/node/polyfills/vm.js
parent8ef08f1d294dbe7e3771202084ecbede73ca28aa (diff)
fix(runtime): use more null proto objects again (#25040)
proceed with #23921 This PR is a preparation for https://github.com/denoland/deno_lint/pull/1307 --------- Signed-off-by: Kenta Moriuchi <moriken@kimamass.com> Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'ext/node/polyfills/vm.js')
-rw-r--r--ext/node/polyfills/vm.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/node/polyfills/vm.js b/ext/node/polyfills/vm.js
index bc1a25045..eb9a0375d 100644
--- a/ext/node/polyfills/vm.js
+++ b/ext/node/polyfills/vm.js
@@ -34,7 +34,7 @@ const kParsingContext = Symbol("script parsing context");
export class Script {
#inner;
- constructor(code, options = {}) {
+ constructor(code, options = { __proto__: null }) {
code = `${code}`;
if (typeof options === "string") {
options = { filename: options };
@@ -80,7 +80,7 @@ export class Script {
: undefined;
}
- #runInContext(contextifiedObject, options = {}) {
+ #runInContext(contextifiedObject, options = { __proto__: null }) {
validateObject(options, "options");
let timeout = options.timeout;
@@ -181,7 +181,10 @@ function getContextOptions(options) {
}
let defaultContextNameIndex = 1;
-export function createContext(contextObject = {}, options = {}) {
+export function createContext(
+ contextObject = {},
+ options = { __proto__: null },
+) {
if (isContext(contextObject)) {
return contextObject;
}
@@ -276,7 +279,7 @@ export function isContext(object) {
return op_vm_is_context(object);
}
-export function compileFunction(code, params, options = {}) {
+export function compileFunction(code, params, options = { __proto__: null }) {
validateString(code, "code");
if (params !== undefined) {
validateStringArray(params, "params");