Repair rewrite.ts attenuate()

This commit is contained in:
Tony Garnock-Jones 2024-03-22 20:49:05 +01:00
parent 036c342264
commit 63b5d23391
1 changed files with 3 additions and 3 deletions

View File

@ -1,9 +1,9 @@
/// SPDX-License-Identifier: GPL-3.0-or-later
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
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 } {