Skip to content

Commit

Permalink
fixup! test: cleanup of fake virtual support for watched promises
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Dec 5, 2023
1 parent ababbe9 commit 6e79669
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/swingset-liveslots/tools/fakeVirtualSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -322,7 +321,7 @@ export function makeFakeWatchedPromiseManager(
collectionManager,
fakeStuff,
) {
const mpm = makeWatchedPromiseManager({
return makeWatchedPromiseManager({
syscall: fakeStuff.syscall,
vrm,
vom,
Expand All @@ -331,8 +330,6 @@ export function makeFakeWatchedPromiseManager(
convertSlotToVal: fakeStuff.convertSlotToVal,
maybeExportPromise: fakeStuff.maybeExportPromise,
});
mpm.preparePromiseWatcherTables();
return mpm;
}

/**
Expand All @@ -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 };
}

Expand Down

0 comments on commit 6e79669

Please sign in to comment.