Skip to content

Commit

Permalink
lib: set Symbol.toStringTag of DOMException
Browse files Browse the repository at this point in the history
PR-URL: #22933
Refs: #22550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
joyeecheung authored and targos committed Sep 21, 2018
1 parent cc82194 commit 5e7b108
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/internal/domexception.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class DOMException extends Error {
}
}

Object.defineProperties(DOMException.prototype, {
[Symbol.toStringTag]: { configurable: true, value: 'DOMException' }
});

for (const [name, codeName, value] of [
['IndexSizeError', 'INDEX_SIZE_ERR', 1],
['DOMStringSizeError', 'DOMSTRING_SIZE_ERR', 2],
Expand Down

0 comments on commit 5e7b108

Please sign in to comment.