From 9e409959f44adfc81d3ba0a2b6709612c5a68a12 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Tue, 31 Dec 2024 13:26:27 -0800 Subject: [PATCH] fixup! Proxy.prototype best efforts --- packages/no-trapping-shim/src/no-trapping-pony.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/no-trapping-shim/src/no-trapping-pony.js b/packages/no-trapping-shim/src/no-trapping-pony.js index 2d48519fce..d41174c7be 100644 --- a/packages/no-trapping-shim/src/no-trapping-pony.js +++ b/packages/no-trapping-shim/src/no-trapping-pony.js @@ -196,6 +196,10 @@ const ProxyPlus = function Proxy(target, handler) { proxyHandlerMap.set(proxy, [target, handler]); return proxy; }; +// The `OriginalProxy` is both constructible (i.e., responsive to `new`) and +// lacks a `prototype` property. The closest we can come to this is to set +// `ProxyPlus.prototype` to `undefined` +ProxyPlus.prototype = undefined; ProxyPlus.revocable = (target, handler) => { const safeHandler = makeSafeHandler(handler); const { proxy, revoke } = OriginalProxy.revocable(target, safeHandler);