summaryrefslogtreecommitdiff
path: root/runtime/js/99_main.js
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-01-25 01:59:55 +1100
committerGitHub <noreply@github.com>2024-01-24 15:59:55 +0100
commit62786cfebb5c9fe36d0930582951f442bdfe9441 (patch)
treea1bede5492a5b1bf4a202ee8994df027f098e788 /runtime/js/99_main.js
parent4af121687cb4c26f4a2f3e4ad266490d8faa3d2d (diff)
feat: deprecate `Deno.close()` (#22066)
For removal in Deno v2. --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'runtime/js/99_main.js')
-rw-r--r--runtime/js/99_main.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 7057f6d62..fe3dab58b 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -542,7 +542,14 @@ const finalDenoNs = {
internals.warnOnDeprecatedApi("Deno.resources()", new Error().stack);
return core.resources();
},
- close: core.close,
+ close(rid) {
+ internals.warnOnDeprecatedApi(
+ "Deno.close()",
+ new Error().stack,
+ "Use `closer.close()` instead.",
+ );
+ core.close(rid);
+ },
...denoNs,
// Deno.test and Deno.bench are noops here, but kept for compatibility; so
// that they don't cause errors when used outside of `deno test`/`deno bench`