diff options
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/40_fs_events.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/runtime/js/40_fs_events.js b/runtime/js/40_fs_events.js index 0bc614335..4c7050b9f 100644 --- a/runtime/js/40_fs_events.js +++ b/runtime/js/40_fs_events.js @@ -27,12 +27,17 @@ class FsWatcher { } get rid() { + internals.warnOnDeprecatedApi( + "Deno.FsWatcher.rid", + new Error().stack, + "Use `Deno.FsWatcher` instance methods instead.", + ); return this.#rid; } async next() { try { - const value = await op_fs_events_poll(this.rid); + const value = await op_fs_events_poll(this.#rid); return value ? { value, done: false } : { value: undefined, done: true }; } catch (error) { if (ObjectPrototypeIsPrototypeOf(BadResourcePrototype, error)) { @@ -49,11 +54,8 @@ 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); + internals.warnOnDeprecatedApi("Deno.FsWatcher.return()", new Error().stack); + core.close(this.#rid); return PromiseResolve({ value, done: true }); } |