From 4c4b538c105e79b11936995f2efddd13fa2ec3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Mon, 25 Sep 2023 19:13:54 +0200 Subject: [PATCH] Fix issues with Deno and clearTimeout --- src/untrusted/lib/createContext.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/untrusted/lib/createContext.ts b/src/untrusted/lib/createContext.ts index 6fb2313..5919869 100644 --- a/src/untrusted/lib/createContext.ts +++ b/src/untrusted/lib/createContext.ts @@ -126,9 +126,6 @@ const setupContextGlobalRefs = (ctx: object) => { */ const createGlobalFunctionProxy = (() => { return (ctx: object, fn: typeof Function.prototype) => { - // Do not proxy constructors - if (fn.prototype && fn.prototype.constructor === fn) return fn; - return new PX(fn, { ['apply'](o, thisArg, argArray) { if (typeof o === 'function') { @@ -141,6 +138,9 @@ const createGlobalFunctionProxy = (() => { throw TE('Not a function'); }, + ['setPrototypeOf']() { + return false; + }, }); }; })();