Skip to content

Commit

Permalink
fix: from my own review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jan 1, 2021
1 parent d30cc35 commit 86212df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/ERTP/src/amountMath.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ function makeAmountMath(brand, amountMathKind) {
const { brand: allegedBrand, value: valuePattern } = allegedAmountPattern;
assert(
allegedBrand !== undefined,
d`alleged brand is undefined. Did you pass a value rather than an amount?`,
d`alleged brand is undefined. Did you pass a value pattern rather than an amount pattern?`,
);
assert(
brand === allegedBrand,
d`the brand in the allegedAmount in 'coerce' didn't match the amountMath brand`,
d`the brand in the allegedAmountPattern in 'coerce' didn't match the amountMath brand`,
);
// Will throw on inappropriate value
return amountMath.makePattern(valuePattern);
Expand Down
8 changes: 4 additions & 4 deletions packages/same-structure/src/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ harden(isGround);
* @returns {Bindings | undefined}
*/
function match(outerPattern, outerSpecimen) {
assert(
isGround(outerSpecimen),
d`Can only match against ground comparables for now`,
);
assert(isGround(outerSpecimen), d`Can only match against ground comparables`);

// Although it violates Jessie, don't harden `bindings` yet
const bindings = { __proto__: null };
Expand All @@ -112,6 +109,9 @@ function match(outerPattern, outerSpecimen) {
case 'bind': {
const { name } = pattern;
// binds specimen to bindings[name]
// TODO because `name` is used as a computed property name, we
// should first `assertKeywordName(name)`. To do so, we must first
// move`assertKeywordName` from the zoe package into this one.
assert.string(name);
if (name in bindings) {
// Note: sameStructure rather than match, as both sides came from
Expand Down

0 comments on commit 86212df

Please sign in to comment.