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 committed Sep 20, 2018
1 parent 085dcf0 commit f91716f
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 f91716f

Please sign in to comment.