summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tsc/dts/lib.deno.ns.d.ts27
-rw-r--r--runtime/js/99_main.js10
-rw-r--r--tests/integration/js_unit_tests.rs1
-rw-r--r--tests/specs/future/runtime_api/main.js1
-rw-r--r--tests/specs/future/runtime_api/main.out1
-rw-r--r--tests/unit/resources_test.ts11
6 files changed, 0 insertions, 51 deletions
diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts
index dcfdb8574..3ec06bf0b 100644
--- a/cli/tsc/dts/lib.deno.ns.d.ts
+++ b/cli/tsc/dts/lib.deno.ns.d.ts
@@ -2265,33 +2265,6 @@ declare namespace Deno {
*/
export function fdatasyncSync(rid: number): void;
- /** Close the given resource ID (`rid`) which has been previously opened, such
- * as via opening or creating a file. Closing a file when you are finished
- * with it is important to avoid leaking resources.
- *
- * ```ts
- * const file = await Deno.open("my_file.txt");
- * // do work with "file" object
- * Deno.close(file.rid);
- * ```
- *
- * It is recommended to define the variable with the `using` keyword so the
- * runtime will automatically close the resource when it goes out of scope.
- * Doing so negates the need to manually close the resource.
- *
- * ```ts
- * using file = await Deno.open("my_file.txt");
- * // do work with "file" object
- * ```
- *
- * @deprecated This will be removed in Deno 2.0. See the
- * {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide}
- * for migration instructions.
- *
- * @category I/O
- */
- export function close(rid: number): void;
-
/** The Deno abstraction for reading and writing files.
*
* This is the most straight forward way of handling files within Deno and is
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 550304af1..17b1e20d8 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -518,14 +518,6 @@ const internalSymbol = Symbol("Deno.internal");
const finalDenoNs = {
internal: internalSymbol,
[internalSymbol]: internals,
- 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`
@@ -822,7 +814,6 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
if (future) {
delete globalThis.window;
delete Deno.Buffer;
- delete Deno.close;
delete Deno.copy;
delete Deno.File;
delete Deno.fstat;
@@ -1005,7 +996,6 @@ function bootstrapWorkerRuntime(
if (future) {
delete Deno.Buffer;
- delete Deno.close;
delete Deno.copy;
delete Deno.File;
delete Deno.fstat;
diff --git a/tests/integration/js_unit_tests.rs b/tests/integration/js_unit_tests.rs
index cbae4a0b8..9c4ac0e52 100644
--- a/tests/integration/js_unit_tests.rs
+++ b/tests/integration/js_unit_tests.rs
@@ -78,7 +78,6 @@ util::unit_test_factory!(
remove_test,
rename_test,
request_test,
- resources_test,
response_test,
serve_test,
signal_test,
diff --git a/tests/specs/future/runtime_api/main.js b/tests/specs/future/runtime_api/main.js
index 6bc83d30c..503b6e5fb 100644
--- a/tests/specs/future/runtime_api/main.js
+++ b/tests/specs/future/runtime_api/main.js
@@ -1,6 +1,5 @@
console.log("window is", globalThis.window);
console.log("Deno.Buffer is", Deno.Buffer);
-console.log("Deno.close is", Deno.close);
console.log("Deno.copy is", Deno.copy);
console.log("Deno.File is", Deno.File);
console.log("Deno.fstat is", Deno.fstat);
diff --git a/tests/specs/future/runtime_api/main.out b/tests/specs/future/runtime_api/main.out
index 2a8167ef9..eca1c3741 100644
--- a/tests/specs/future/runtime_api/main.out
+++ b/tests/specs/future/runtime_api/main.out
@@ -1,6 +1,5 @@
window is undefined
Deno.Buffer is undefined
-Deno.close is undefined
Deno.copy is undefined
Deno.File is undefined
Deno.fstat is undefined
diff --git a/tests/unit/resources_test.ts b/tests/unit/resources_test.ts
deleted file mode 100644
index 3c692a1a4..000000000
--- a/tests/unit/resources_test.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-
-// deno-lint-ignore-file no-deprecated-deno-api
-
-import { assertThrows } from "./test_util.ts";
-
-Deno.test(function resourcesCloseBadArgs() {
- assertThrows(() => {
- Deno.close((null as unknown) as number);
- }, TypeError);
-});