Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore(fs): undeprecate Deno.FsWatcher.prototype.return() #25623

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cli/tsc/dts/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<IteratorResult<FsEvent>>;
[Symbol.asyncIterator](): AsyncIterableIterator<FsEvent>;
Expand Down
3 changes: 0 additions & 3 deletions runtime/js/40_fs_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/fs_events_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down