Skip to content

Commit

Permalink
chore(liveslots): add weakRefFor() to mock GC tools
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Apr 29, 2023
1 parent 6b063ef commit f357672
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/swingset-liveslots/test/mock-gc.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export function makeMockGC() {
log(` kill done`);
}

function weakRefFor(val) {
return valToWeakRef.get(val);
}

const mockFinalizationRegistryProto = {
register(val, context) {
log(`FR.register(context=${context})`);
Expand Down Expand Up @@ -95,6 +99,7 @@ export function makeMockGC() {
WeakRef: mockWeakRef,
FinalizationRegistry: mockFinalizationRegistry,
kill,
weakRefFor,
getAllFRs,
flushAllFRs,
waitUntilQuiescent,
Expand Down

0 comments on commit f357672

Please sign in to comment.