Skip to content

Commit

Permalink
fixup! PanicTag
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jun 9, 2024
1 parent 2b1ae04 commit fbac9e9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/async-flow/src/replay-membrane.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ export const makeReplayMembrane = (

let stopped = false;

const PanicTag = (template, ...args) =>
panic(makeError(X(template, ...args)));
const Panic = (template, ...args) => panic(makeError(X(template, ...args)));

// ////////////// Host or Interpreter to Guest ///////////////////////////////

Expand Down Expand Up @@ -202,7 +201,7 @@ export const makeReplayMembrane = (
default: {
// @ts-expect-error TS correctly knows this case would be outside
// the type. But that's what we want to check.
throw PanicTag`unexpected outcome kind ${q(outcome.kind)}`;
throw Panic`unexpected outcome kind ${q(outcome.kind)}`;
}
}
};
Expand All @@ -212,9 +211,9 @@ export const makeReplayMembrane = (
const guestHandler = harden({
applyMethod(guestTarget, optVerb, guestArgs, guestReturnedP) {
if (optVerb === undefined) {
throw PanicTag`guest eventual call not yet supported: ${guestTarget}(${b(guestArgs)}) -> ${b(guestReturnedP)}`;
throw Panic`guest eventual call not yet supported: ${guestTarget}(${b(guestArgs)}) -> ${b(guestReturnedP)}`;
} else {
throw PanicTag`guest eventual send not yet supported: ${guestTarget}.${b(optVerb)}(${b(guestArgs)}) -> ${b(guestReturnedP)}`;
throw Panic`guest eventual send not yet supported: ${guestTarget}.${b(optVerb)}(${b(guestArgs)}) -> ${b(guestReturnedP)}`;
}
},
applyFunction(guestTarget, guestArgs, guestReturnedP) {
Expand All @@ -226,7 +225,7 @@ export const makeReplayMembrane = (
);
},
get(guestTarget, prop, guestReturnedP) {
throw PanicTag`guest eventual get not yet supported: ${guestTarget}.${b(prop)} -> ${b(guestReturnedP)}`;
throw Panic`guest eventual get not yet supported: ${guestTarget}.${b(prop)} -> ${b(guestReturnedP)}`;
},
});

Expand Down

0 comments on commit fbac9e9

Please sign in to comment.