diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2022-12-20 11:37:50 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-20 03:37:50 +0100 |
commit | 948f85216a15e4ef489af21bb532a9b201b0364c (patch) | |
tree | 35c2bbfa021cf9a4190ab803ed091c5547bfe9f4 /ext/web/05_base64.js | |
parent | 2ac575abfb75dc4533306c80240cb1beeb816b9b (diff) |
chore: Update dlint (#17031)
Introduces `SafeSetIterator` and `SafeMapIterator` to primordials
Diffstat (limited to 'ext/web/05_base64.js')
-rw-r--r-- | ext/web/05_base64.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/web/05_base64.js b/ext/web/05_base64.js index 89c409ae2..d963596ce 100644 --- a/ext/web/05_base64.js +++ b/ext/web/05_base64.js @@ -13,7 +13,10 @@ const ops = core.ops; const webidl = window.__bootstrap.webidl; const { DOMException } = window.__bootstrap.domException; - const { TypeError } = window.__bootstrap.primordials; + const { + ObjectPrototypeIsPrototypeOf, + TypeErrorPrototype, + } = window.__bootstrap.primordials; /** * @param {string} data @@ -29,7 +32,7 @@ try { return ops.op_base64_atob(data); } catch (e) { - if (e instanceof TypeError) { + if (ObjectPrototypeIsPrototypeOf(TypeErrorPrototype, e)) { throw new DOMException( "Failed to decode base64: invalid character", "InvalidCharacterError", @@ -53,7 +56,7 @@ try { return ops.op_base64_btoa(data); } catch (e) { - if (e instanceof TypeError) { + if (ObjectPrototypeIsPrototypeOf(TypeErrorPrototype, e)) { throw new DOMException( "The string to be encoded contains characters outside of the Latin1 range.", "InvalidCharacterError", |