diff --git a/cache/_serialize_arg_list_test.ts b/cache/_serialize_arg_list_test.ts index f6656e0676c2..12b36f1c3008 100644 --- a/cache/_serialize_arg_list_test.ts +++ b/cache/_serialize_arg_list_test.ts @@ -142,13 +142,13 @@ Deno.test("_serializeArgList() cleans up cache entries when finalization callbac }); Deno.test("_serializeArgList() allows garbage collection for weak keys", async () => { - // @ts-expect-error - Triggering true garbage collection is only available - // with `--v8-flags="--expose-gc"`, so we mock `FinalizationRegistry` with - // `using` and some `Symbol.dispose` trickery if it's not available. Run this - // test with `deno test --v8-flags="--expose-gc"` to test actual gc behavior + // Triggering true garbage collection is only available with + // `--v8-flags="--expose-gc"`, so we mock `FinalizationRegistry` with `using` + // and some `Symbol.dispose` trickery if it's not available. Run this test + // with `deno test --v8-flags="--expose-gc"` to test actual gc behavior // (however, even calling `globalThis.gc` doesn't _guarantee_ garbage // collection, so this may be flaky between v8 versions etc.) - const gc = globalThis.gc as undefined | (() => void); + const gc = Reflect.get(globalThis, "gc") as (() => void) | undefined; class MockFinalizationRegistry extends FinalizationRegistry { #cleanupCallback: (heldValue: T) => void;