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; + }, }); }; })();