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

FUTURE(ext/fs): remove Deno.FsWatcher.prototype.rid (#23234)

This commit is contained in:
Asher Gomez 2024-04-07 17:46:39 +10:00 committed by GitHub
parent d3f3e0d717
commit 9b34b7ed18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View file

@ -11,6 +11,7 @@ const {
ObjectPrototypeIsPrototypeOf,
PromiseResolve,
SymbolAsyncIterator,
ObjectDefineProperty,
} = primordials;
import { SymbolDispose } from "ext:deno_web/00_infra.js";
@ -20,6 +21,12 @@ class FsWatcher {
#promise;
constructor(paths, options) {
if (internals.future) {
ObjectDefineProperty(this, "rid", {
enumerable: false,
value: undefined,
});
}
const { recursive } = options;
this.#rid = op_fs_events_open({ recursive, paths });
}

View file

@ -31,6 +31,10 @@ console.log("Deno.writeAllSync is", Deno.writeAllSync);
console.log("Deno.write is", Deno.write);
console.log("Deno.writeSync is", Deno.writeSync);
const watcher = Deno.watchFs(".");
console.log("Deno.FsWatcher.prototype.rid is", watcher.rid);
watcher.close();
try {
new Deno.FsFile(0);
} catch (error) {

View file

@ -27,4 +27,5 @@ Deno.writeAll is undefined
Deno.writeAllSync is undefined
Deno.write is undefined
Deno.writeSync is undefined
Deno.FsWatcher.prototype.rid is undefined
Deno.FsFile constructor is illegal