diff --git a/packages/base-zone/src/heap.js b/packages/base-zone/src/heap.js index 839cd2abaf13..3445255e8d57 100644 --- a/packages/base-zone/src/heap.js +++ b/packages/base-zone/src/heap.js @@ -1,7 +1,7 @@ // @ts-check // @jessie-check -import { Far } from '@endo/far'; +import { Far, isPassable } from '@endo/pass-style'; import { makeExo, defineExoClass, defineExoClassKit } from '@endo/exo'; import { makeScalarMapStore, @@ -12,7 +12,6 @@ import { import { makeOnceKit } from './make-once.js'; import { agoricVatDataKeys as keys } from './keys.js'; -import { isPassable } from './is-passable.js'; /** * @type {import('./types.js').Stores} diff --git a/packages/base-zone/src/is-passable.js b/packages/base-zone/src/is-passable.js deleted file mode 100644 index 258c510c6149..000000000000 --- a/packages/base-zone/src/is-passable.js +++ /dev/null @@ -1,23 +0,0 @@ -import { passStyleOf } from '@endo/pass-style'; - -/** - * Is `specimen` Passable? This returns true iff `passStyleOf(specimen)` - * returns a string. This returns `false` iff `passStyleOf(specimen)` throws. - * Under no normal circumstance should `isPassable(specimen)` throw. - * - * TODO implement an isPassable that does not rely on try/catch, and - * move it to @endo/pass-style. - * This implementation is just a standin until then - * - * @param {any} specimen - * @returns {specimen is Passable} - */ -export const isPassable = specimen => { - try { - // In fact, it never returns undefined. It either returns a - // string or throws. - return passStyleOf(specimen) !== undefined; - } catch (_) { - return false; - } -}; diff --git a/packages/zone/src/durable.js b/packages/zone/src/durable.js index 2d248531594f..75f632e9e00a 100644 --- a/packages/zone/src/durable.js +++ b/packages/zone/src/durable.js @@ -1,7 +1,7 @@ // @ts-check // @jessie-check -import { Far } from '@endo/far'; +import { Far, isPassable } from '@endo/pass-style'; import { canBeDurable, makeScalarMapStore, @@ -14,11 +14,7 @@ import { provideDurableWeakSetStore, } from '@agoric/vat-data'; -import { - agoricVatDataKeys as keys, - isPassable, - makeOnceKit, -} from '@agoric/base-zone'; +import { agoricVatDataKeys as keys, makeOnceKit } from '@agoric/base-zone'; const { Fail } = assert; diff --git a/packages/zone/src/virtual.js b/packages/zone/src/virtual.js index 95410799db0c..89a0a78a37c9 100644 --- a/packages/zone/src/virtual.js +++ b/packages/zone/src/virtual.js @@ -1,7 +1,7 @@ // @ts-check // @jessie-check -import { Far } from '@endo/far'; +import { Far, isPassable } from '@endo/pass-style'; import { defineVirtualExoClass, defineVirtualExoClassKit, @@ -11,11 +11,7 @@ import { makeScalarBigWeakSetStore, } from '@agoric/vat-data'; -import { - agoricVatDataKeys as keys, - isPassable, - makeOnceKit, -} from '@agoric/base-zone'; +import { agoricVatDataKeys as keys, makeOnceKit } from '@agoric/base-zone'; const emptyRecord = harden({}); const initEmpty = harden(() => emptyRecord);