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:
parent
8fe90d2861
commit
51d926ac30
3 changed files with 0 additions and 9 deletions
4
cli/tsc/dts/lib.deno.ns.d.ts
vendored
4
cli/tsc/dts/lib.deno.ns.d.ts
vendored
|
@ -3484,10 +3484,6 @@ declare namespace Deno {
|
||||||
close(): void;
|
close(): void;
|
||||||
/**
|
/**
|
||||||
* Stops watching the file system and closes the watcher resource.
|
* 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>>;
|
return?(value?: any): Promise<IteratorResult<FsEvent>>;
|
||||||
[Symbol.asyncIterator](): AsyncIterableIterator<FsEvent>;
|
[Symbol.asyncIterator](): AsyncIterableIterator<FsEvent>;
|
||||||
|
|
|
@ -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) {
|
return(value) {
|
||||||
internals.warnOnDeprecatedApi("Deno.FsWatcher.return()", new Error().stack);
|
|
||||||
core.close(this.#rid);
|
core.close(this.#rid);
|
||||||
return PromiseResolve({ value, done: true });
|
return PromiseResolve({ value, done: true });
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(
|
Deno.test(
|
||||||
{ permissions: { read: true, write: true } },
|
{ permissions: { read: true, write: true } },
|
||||||
async function watchFsReturn() {
|
async function watchFsReturn() {
|
||||||
|
|
Loading…
Reference in a new issue