summaryrefslogtreecommitdiff
path: root/ext/web/01_dom_exception.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/web/01_dom_exception.js')
-rw-r--r--ext/web/01_dom_exception.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/web/01_dom_exception.js b/ext/web/01_dom_exception.js
index 44aa72abe..a3beb3064 100644
--- a/ext/web/01_dom_exception.js
+++ b/ext/web/01_dom_exception.js
@@ -16,6 +16,7 @@
ErrorPrototype,
ObjectDefineProperty,
ObjectEntries,
+ ObjectPrototypeIsPrototypeOf,
ObjectSetPrototypeOf,
SymbolFor,
} = window.__bootstrap.primordials;
@@ -126,7 +127,7 @@
}
[SymbolFor("Deno.customInspect")](inspect) {
- if (this instanceof DOMException) {
+ if (ObjectPrototypeIsPrototypeOf(DOMExceptionPrototype, this)) {
return `DOMException: ${this.#message}`;
} else {
return inspect(consoleInternal.createFilteredInspectProxy({
@@ -145,6 +146,7 @@
ObjectSetPrototypeOf(DOMException.prototype, ErrorPrototype);
webidl.configurePrototype(DOMException);
+ const DOMExceptionPrototype = DOMException.prototype;
for (
const [key, value] of ObjectEntries({