From 947ce41e99637dae4cf46126b8bb2d4107fb9913 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Wed, 24 Jan 2024 10:27:29 +1100 Subject: feat: deprecate `Deno.resources()` (#22059) Most uses of `Deno.resources()` within tests, as they previously checked for leaked resources. This is not needed as the test runner does this automatically. Other internal uses of this API have been replaced with the internal `Deno[Deno.internal].core.resources()`. --- cli/tests/testdata/run/fetch_response_finalization.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/tests/testdata') diff --git a/cli/tests/testdata/run/fetch_response_finalization.js b/cli/tests/testdata/run/fetch_response_finalization.js index dd7c355eb..85fc6afa3 100644 --- a/cli/tests/testdata/run/fetch_response_finalization.js +++ b/cli/tests/testdata/run/fetch_response_finalization.js @@ -1,6 +1,6 @@ async function doAFetch() { const resp = await fetch("http://localhost:4545/README.md"); - console.log(Deno.resources()); // print the current resources + console.log(Deno[Deno.internal].core.resources()); // print the current resources const _resp = resp; // at this point resp can be GC'ed } @@ -13,4 +13,4 @@ globalThis.gc(); // force GC // the response body is not called and the resource is not closed. await new Promise((resolve) => setTimeout(resolve, 0)); -console.log(Deno.resources()); // print the current resources +console.log(Deno[Deno.internal].core.resources()); // print the current resources -- cgit v1.2.3