From 8e202455604a1a5ec1e500ea8b0de05a7ef87d51 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Fri, 12 Feb 2021 20:02:38 -0800 Subject: [PATCH] fix: removed another q --- packages/SwingSet/src/kernel/vatManager/factory.js | 3 ++- packages/SwingSet/src/netstring.js | 4 ++-- packages/SwingSet/test/test-netstring.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/SwingSet/src/kernel/vatManager/factory.js b/packages/SwingSet/src/kernel/vatManager/factory.js index 9ad19ae9a31..bf6dff91fd8 100644 --- a/packages/SwingSet/src/kernel/vatManager/factory.js +++ b/packages/SwingSet/src/kernel/vatManager/factory.js @@ -70,7 +70,8 @@ export function makeVatManagerFactory({ !bundle || typeof bundle === 'object', `bundle must be object, not a plain string`, ); - assert(!setup || enableSetup, X`setup() provided, but not enabled`); // todo maybe useless + // todo maybe useless + assert(!(setup && !enableSetup), X`setup() provided, but not enabled`); } // returns promise for new vatManager diff --git a/packages/SwingSet/src/netstring.js b/packages/SwingSet/src/netstring.js index b6ead9dd2d4..8490196946c 100644 --- a/packages/SwingSet/src/netstring.js +++ b/packages/SwingSet/src/netstring.js @@ -1,4 +1,4 @@ -import { assert, details as X, q } from '@agoric/assert'; +import { assert, details as X } from '@agoric/assert'; // adapted from 'netstring-stream', https://github.com/tlivings/netstring-stream/ const { Transform } = require('stream'); @@ -51,7 +51,7 @@ export function decode(data) { const size = parseInt(sizeString, 10); if (!(size > -1)) { // reject NaN, all negative numbers - assert.fail(X`unparseable size ${q(sizeString)}, should be integer`); + assert.fail(X`unparseable size ${sizeString}, should be integer`); } if (data.length < colon + 1 + size + 1) { break; // still waiting for `${DATA}.` diff --git a/packages/SwingSet/test/test-netstring.js b/packages/SwingSet/test/test-netstring.js index d79d8761074..6c6c14d0e52 100644 --- a/packages/SwingSet/test/test-netstring.js +++ b/packages/SwingSet/test/test-netstring.js @@ -106,7 +106,7 @@ test('decode', t => { } // bad('a', 'non-numeric length prefix'); - bad('a:', `unparseable size "a", should be integer`); + bad('a:', /unparseable size .*, should be integer/); bad('1:ab', 'malformed netstring: not terminated by comma'); });