From 51d926ac30413a6747505b3f248f43a563470545 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 17 Sep 2024 07:57:53 +1000 Subject: chore(fs): undeprecate `Deno.FsWatcher.prototype.return()` (#25623) --- cli/tsc/dts/lib.deno.ns.d.ts | 4 ---- runtime/js/40_fs_events.js | 3 --- tests/unit/fs_events_test.ts | 2 -- 3 files changed, 9 deletions(-) diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index d27fc380d..f44bf9a02 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -3484,10 +3484,6 @@ declare namespace Deno { close(): void; /** * Stops watching the file system and closes the watcher resource. - * - * @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. */ return?(value?: any): Promise>; [Symbol.asyncIterator](): AsyncIterableIterator; diff --git a/runtime/js/40_fs_events.js b/runtime/js/40_fs_events.js index a1c40c5e5..c20f9ed23 100644 --- a/runtime/js/40_fs_events.js +++ b/runtime/js/40_fs_events.js @@ -49,10 +49,7 @@ class FsWatcher { } } - // TODO(kt3k): This is deprecated. Will be removed in v2.0. - // See https://github.com/denoland/deno/issues/10577 for details return(value) { - internals.warnOnDeprecatedApi("Deno.FsWatcher.return()", new Error().stack); core.close(this.#rid); return PromiseResolve({ value, done: true }); } diff --git a/tests/unit/fs_events_test.ts b/tests/unit/fs_events_test.ts index 148688215..cc2f2cd57 100644 --- a/tests/unit/fs_events_test.ts +++ b/tests/unit/fs_events_test.ts @@ -90,8 +90,6 @@ Deno.test( }, ); -// TODO(kt3k): This test is for the backward compatibility of `.return` method. -// This should be removed at 2.0 Deno.test( { permissions: { read: true, write: true } }, async function watchFsReturn() { -- cgit v1.2.3