From 63b5d23391ff2d8a7831048f36f3584f42bd49db Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 22 Mar 2024 20:49:05 +0100 Subject: [PATCH] Repair rewrite.ts attenuate() --- packages/core/src/runtime/rewrite.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 } {