-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! patch endo #2408 so we can use it
- Loading branch information
Showing
2 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
diff --git a/node_modules/@endo/compartment-mapper/src/policy.js b/node_modules/@endo/compartment-mapper/src/policy.js | ||
index ee2a8fb..98af69a 100644 | ||
--- a/node_modules/@endo/compartment-mapper/src/policy.js | ||
+++ b/node_modules/@endo/compartment-mapper/src/policy.js | ||
@@ -10,7 +10,9 @@ import { | ||
policyLookupHelper, | ||
} from './policy-format.js'; | ||
|
||
-const { create, entries, values, assign, keys, freeze } = Object; | ||
+const { create, entries, values, assign, freeze, getOwnPropertyDescriptors } = | ||
+ Object; | ||
+const { ownKeys } = Reflect; | ||
const q = JSON.stringify; | ||
|
||
/** | ||
@@ -28,7 +30,12 @@ export const ATTENUATORS_COMPARTMENT = '<ATTENUATORS>'; | ||
*/ | ||
const selectiveCopy = (from, to, list) => { | ||
if (!list) { | ||
- list = keys(from); | ||
+ const descs = getOwnPropertyDescriptors(from); | ||
+ list = ownKeys(from).filter( | ||
+ key => | ||
+ // @ts-expect-error TypeScript still confused about a symbol as index | ||
+ descs[key].enumerable, | ||
+ ); | ||
} | ||
for (let index = 0; index < list.length; index += 1) { | ||
const key = list[index]; |