summaryrefslogtreecommitdiff
path: root/ext/net/01_net.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 /ext/net/01_net.js
parent382a978859a7a7a4351542be818bb2e59523429c (diff)
Revert "refactor: update runtime code for primordial checks for "instanceof" (#13497)" (#13511)
This reverts commit 884143218fad0e18f7553aaf079d52de703f7601.
Diffstat (limited to 'ext/net/01_net.js')
-rw-r--r--ext/net/01_net.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/ext/net/01_net.js b/ext/net/01_net.js
index 145a89b4f..4a4005954 100644
--- a/ext/net/01_net.js
+++ b/ext/net/01_net.js
@@ -3,9 +3,8 @@
((window) => {
const core = window.Deno.core;
- const { BadResourcePrototype, InterruptedPrototype } = core;
+ const { BadResource, Interrupted } = core;
const {
- ObjectPrototypeIsPrototypeOf,
PromiseResolve,
SymbolAsyncIterator,
Uint8Array,
@@ -125,10 +124,7 @@
try {
conn = await this.accept();
} catch (error) {
- if (
- ObjectPrototypeIsPrototypeOf(BadResourcePrototype, error) ||
- ObjectPrototypeIsPrototypeOf(InterruptedPrototype, error)
- ) {
+ if (error instanceof BadResource || error instanceof Interrupted) {
return { value: undefined, done: true };
}
throw error;
@@ -195,10 +191,7 @@
try {
yield await this.receive();
} catch (err) {
- if (
- ObjectPrototypeIsPrototypeOf(BadResourcePrototype, err) ||
- ObjectPrototypeIsPrototypeOf(InterruptedPrototype, err)
- ) {
+ if (err instanceof BadResource || err instanceof Interrupted) {
break;
}
throw err;