From ccdd895ac2945bafa78385aa1ad0e1e0f9b270eb Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Sat, 14 Sep 2024 09:14:11 +1000 Subject: [PATCH] chore(fs): undeprecate `Deno.FsWatcher.prototype.return()` --- 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 00eff1e233c47c..5a2b8df9773a91 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -3496,10 +3496,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 2140f29eb02148..6b721d6e3aa0cf 100644 --- a/runtime/js/40_fs_events.js +++ b/runtime/js/40_fs_events.js @@ -57,10 +57,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 1486882152b1c7..cc2f2cd5711242 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() {