From 6e796696cca757a36ecfcfe110014650cacaa2c8 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Mon, 4 Dec 2023 17:50:34 -0800 Subject: [PATCH] fixup! test: cleanup of fake virtual support for watched promises --- .../swingset-liveslots/tools/fakeVirtualSupport.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/swingset-liveslots/tools/fakeVirtualSupport.js b/packages/swingset-liveslots/tools/fakeVirtualSupport.js index 35c422e823a..88bd25eeb93 100644 --- a/packages/swingset-liveslots/tools/fakeVirtualSupport.js +++ b/packages/swingset-liveslots/tools/fakeVirtualSupport.js @@ -165,8 +165,7 @@ export function makeFakeLiveSlotsStuff(options = {}) { } function allocatePromiseID() { - const promiseID = vrm.allocateNextID('promiseID'); - return makeVatSlot('promise', true, promiseID); + return vrm.allocateNextID('promiseID'); } function allocateCollectionID() { @@ -202,7 +201,7 @@ export function makeFakeLiveSlotsStuff(options = {}) { function convertValToSlot(val) { if (!valToSlot.has(val)) { const slot = isPromise(val) - ? allocatePromiseID() + ? `p+${allocatePromiseID()}` : `o+${allocateExportID()}`; valToSlot.set(val, slot); setValForSlot(slot, val); @@ -322,7 +321,7 @@ export function makeFakeWatchedPromiseManager( collectionManager, fakeStuff, ) { - const mpm = makeWatchedPromiseManager({ + return makeWatchedPromiseManager({ syscall: fakeStuff.syscall, vrm, vom, @@ -331,8 +330,6 @@ export function makeFakeWatchedPromiseManager( convertSlotToVal: fakeStuff.convertSlotToVal, maybeExportPromise: fakeStuff.maybeExportPromise, }); - mpm.preparePromiseWatcherTables(); - return mpm; } /** @@ -359,6 +356,7 @@ export function makeFakeVirtualStuff(options = {}) { vom.initializeKindHandleKind(); const cm = makeFakeCollectionManager(vrm, fakeStuff, actualOptions); const wpm = makeFakeWatchedPromiseManager(vrm, vom, cm, fakeStuff); + wpm.preparePromiseWatcherTables(); return { fakeStuff, vrm, vom, cm, wpm }; }