From a46e86d09da015893b39aeee6ec6eb1006e58a00 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Mon, 6 Jan 2025 15:19:07 -0800 Subject: [PATCH] fixup! default to freeze,isFrozen if absent --- packages/marshal/src/encodeToCapData.js | 3 ++- packages/pass-style/src/remotable.js | 2 +- packages/pass-style/src/safe-promise.js | 2 +- packages/ses/src/commons.js | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/marshal/src/encodeToCapData.js b/packages/marshal/src/encodeToCapData.js index 698c0f6f12..5f921939d5 100644 --- a/packages/marshal/src/encodeToCapData.js +++ b/packages/marshal/src/encodeToCapData.js @@ -30,8 +30,9 @@ const { is, entries, fromEntries, + freeze, // @ts-expect-error TS doesn't see this on ObjectConstructor - suppressTrapping, + suppressTrapping = freeze, } = Object; /** diff --git a/packages/pass-style/src/remotable.js b/packages/pass-style/src/remotable.js index 91554d4577..2563a07e6c 100644 --- a/packages/pass-style/src/remotable.js +++ b/packages/pass-style/src/remotable.js @@ -28,7 +28,7 @@ const { getOwnPropertyDescriptors, isFrozen, // @ts-expect-error TS does not yet have `isNonTrapping` on ObjectConstructor - isNonTrapping, + isNonTrapping = isFrozen, } = Object; /** diff --git a/packages/pass-style/src/safe-promise.js b/packages/pass-style/src/safe-promise.js index aa905b46de..f1fceba3e7 100644 --- a/packages/pass-style/src/safe-promise.js +++ b/packages/pass-style/src/safe-promise.js @@ -11,7 +11,7 @@ const { getOwnPropertyDescriptor, isFrozen, // @ts-expect-error TS does not yet have `isNonTrapping` on ObjectConstructor - isNonTrapping, + isNonTrapping = isFrozen, } = Object; const { ownKeys } = Reflect; const { toStringTag } = Symbol; diff --git a/packages/ses/src/commons.js b/packages/ses/src/commons.js index ee85ca71e8..ee913b6e93 100644 --- a/packages/ses/src/commons.js +++ b/packages/ses/src/commons.js @@ -79,9 +79,9 @@ export const { fromEntries, // https://github.com/endojs/endo/pull/2673 // @ts-expect-error TS does not yet have this on ObjectConstructor. - isNonTrapping, + isNonTrapping = isFrozen, // @ts-expect-error TS does not yet have this on ObjectConstructor. - suppressTrapping, + suppressTrapping = freeze, } = Object; export const {