From 9af71ab3130af9f1919f780751dc7b94d1b10441 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Thu, 6 Jan 2022 22:48:52 -0800 Subject: [PATCH] fix: missing Far on some iterables --- packages/store/src/keys/copyMap.js | 5 +++-- packages/store/src/stores/store-utils.js | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/store/src/keys/copyMap.js b/packages/store/src/keys/copyMap.js index 14eb39d9b13e..0f2517e1f1b9 100644 --- a/packages/store/src/keys/copyMap.js +++ b/packages/store/src/keys/copyMap.js @@ -2,6 +2,7 @@ import { assertChecker, + Far, getTag, makeTagged, passStyleOf, @@ -95,10 +96,10 @@ export const getCopyMapEntries = m => { payload: { keys, values }, } = m; const { length } = keys; - return harden({ + return Far('CopyMap entries iterable', { [Symbol.iterator]: () => { let i = 0; - return harden({ + return Far('CopyMap entries iterator', { next: () => { /** @type {IteratorResult<[K,V],void>} */ let result; diff --git a/packages/store/src/stores/store-utils.js b/packages/store/src/stores/store-utils.js index 10b1c6ba5e97..08402372e6a2 100644 --- a/packages/store/src/stores/store-utils.js +++ b/packages/store/src/stores/store-utils.js @@ -1,5 +1,7 @@ // @ts-check +import { Far } from '@agoric/marshal'; + const { details: X, quote: q } = assert; /** @@ -54,13 +56,13 @@ export const makeCurrentKeysKit = ( return sortedKeysMemo; }; - const iterableKeys = harden({ + const iterableKeys = Far('Iterable of keys', { [Symbol.iterator]: () => { const generation = updateCount; getSortedKeys(); const len = sortedKeysMemo.length; let i = 0; - return harden({ + return Far('Iterator of keys', { next: () => { assert.equal( generation,