summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/assert.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/assert.ts')
-rw-r--r--ext/node/polyfills/assert.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/node/polyfills/assert.ts b/ext/node/polyfills/assert.ts
index 00677e3f7..188c7a0c2 100644
--- a/ext/node/polyfills/assert.ts
+++ b/ext/node/polyfills/assert.ts
@@ -746,6 +746,9 @@ function validateThrownError(
message = error;
error = undefined;
}
+ if (error?.prototype !== undefined && e instanceof error) {
+ return true;
+ }
if (
typeof error === "function" &&
(error === Error || ObjectPrototypeIsPrototypeOf(Error, error))