summaryrefslogtreecommitdiff
path: root/runtime/js/40_fs_events.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-01-27 16:27:22 +0100
committerGitHub <noreply@github.com>2022-01-27 16:27:22 +0100
commitf248e6f1778dc26db91d3322de2ecca5d1aa9866 (patch)
tree46b1ff59091cc8d31ff67427173d3a0148734007 /runtime/js/40_fs_events.js
parent382a978859a7a7a4351542be818bb2e59523429c (diff)
Revert "refactor: update runtime code for primordial checks for "instanceof" (#13497)" (#13511)
This reverts commit 884143218fad0e18f7553aaf079d52de703f7601.
Diffstat (limited to 'runtime/js/40_fs_events.js')
-rw-r--r--runtime/js/40_fs_events.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/runtime/js/40_fs_events.js b/runtime/js/40_fs_events.js
index 939d3ac7b..27825eaac 100644
--- a/runtime/js/40_fs_events.js
+++ b/runtime/js/40_fs_events.js
@@ -3,10 +3,9 @@
((window) => {
const core = window.Deno.core;
- const { BadResourcePrototype, InterruptedPrototype } = core;
+ const { errors } = window.__bootstrap.errors;
const {
ArrayIsArray,
- ObjectPrototypeIsPrototypeOf,
PromiseResolve,
SymbolAsyncIterator,
} = window.__bootstrap.primordials;
@@ -29,11 +28,9 @@
? { value, done: false }
: { value: undefined, done: true };
} catch (error) {
- if (ObjectPrototypeIsPrototypeOf(BadResourcePrototype, error)) {
+ if (error instanceof errors.BadResource) {
return { value: undefined, done: true };
- } else if (
- ObjectPrototypeIsPrototypeOf(InterruptedPrototype, error)
- ) {
+ } else if (error instanceof errors.Interrupted) {
return { value: undefined, done: true };
}
throw error;