diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-01-27 13:36:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 13:36:36 +0100 |
commit | 884143218fad0e18f7553aaf079d52de703f7601 (patch) | |
tree | 9b9e9d30ea647041438ef8fa974b8d4234cabf73 /ext/web/01_dom_exception.js | |
parent | dcf8f144ab0516936bfa4e93357d71f1732d880e (diff) |
refactor: update runtime code for primordial checks for "instanceof" (#13497)
Diffstat (limited to 'ext/web/01_dom_exception.js')
-rw-r--r-- | ext/web/01_dom_exception.js | 4 |
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({ |