1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

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

This commit is contained in:
Asher Gomez 2024-09-17 07:57:53 +10:00 committed by GitHub
parent 8fe90d2861
commit 51d926ac30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 0 additions and 9 deletions

View file

@ -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<IteratorResult<FsEvent>>;
[Symbol.asyncIterator](): AsyncIterableIterator<FsEvent>;

View file

@ -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 });
}

View file

@ -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() {