summaryrefslogtreecommitdiff
path: root/runtime/js/40_fs_events.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-07-04 00:17:52 +0200
committerGitHub <noreply@github.com>2021-07-04 00:17:52 +0200
commit5addba2abc2e384e751e8884b4ac3219688c2473 (patch)
treea5249a82092909f32a852a910e5e144ddeffa497 /runtime/js/40_fs_events.js
parentffa75be48044255ed49a822a7a61a2a130123a4a (diff)
refactor: use primordials in runtime/, part2 (#11248)
Diffstat (limited to 'runtime/js/40_fs_events.js')
-rw-r--r--runtime/js/40_fs_events.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/js/40_fs_events.js b/runtime/js/40_fs_events.js
index 48060e23a..8402cb459 100644
--- a/runtime/js/40_fs_events.js
+++ b/runtime/js/40_fs_events.js
@@ -4,7 +4,11 @@
((window) => {
const core = window.Deno.core;
const { errors } = window.__bootstrap.errors;
-
+ const {
+ ArrayIsArray,
+ PromiseResolve,
+ SymbolAsyncIterator,
+ } = window.__bootstrap.primordials;
class FsWatcher {
#rid = 0;
@@ -37,14 +41,14 @@
// See https://github.com/denoland/deno/issues/10577 for details
return(value) {
core.close(this.rid);
- return Promise.resolve({ value, done: true });
+ return PromiseResolve({ value, done: true });
}
close() {
core.close(this.rid);
}
- [Symbol.asyncIterator]() {
+ [SymbolAsyncIterator]() {
return this;
}
}
@@ -53,7 +57,7 @@
paths,
options = { recursive: true },
) {
- return new FsWatcher(Array.isArray(paths) ? paths : [paths], options);
+ return new FsWatcher(ArrayIsArray(paths) ? paths : [paths], options);
}
window.__bootstrap.fsEvents = {