diff --git a/packages/core/src/runtime/rewrite.ts b/packages/core/src/runtime/rewrite.ts index 6f8004f..0150518 100644 --- a/packages/core/src/runtime/rewrite.ts +++ b/packages/core/src/runtime/rewrite.ts @@ -1,9 +1,9 @@ /// SPDX-License-Identifier: GPL-3.0-or-later /// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones -import { Turn } from "./actor.js"; +import { Turn, Ref } from "./actor.js"; import { Bytes, Dictionary, DoubleFloat, IdentityMap, is, isEmbedded, Record, Tuple, stringify } from "@preserves/core"; -import type { Assertion, Handle, Ref } from "./actor.js"; +import type { Assertion, Handle } from "./actor.js"; import type { SturdyValue } from "../transport/sturdy.js"; import { @@ -200,7 +200,7 @@ export function rmap(... rewrites: [Pattern, Template][]): Caveat { export function attenuate(ref: Ref, ... a: Caveat[]): Ref { if (a.length === 0) return ref; - return { ... ref, attenuation: [... (ref.attenuation ?? []), ... a] }; + return new Ref(ref.relay, ref.target, [... (ref.attenuation ?? []), ... a]); } export function forwarder(ref: Ref): { proxy: Ref, revoker: Ref } {