From 6ec4332de1114dafcb2db7ad6f5638b2c994cd90 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 18 Sep 2018 10:17:06 -0400 Subject: [PATCH] lib: set Symbol.toStringTag of DOMException --- lib/internal/domexception.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/internal/domexception.js b/lib/internal/domexception.js index fe371e099eb17f..bd2ad958ae4c1b 100644 --- a/lib/internal/domexception.js +++ b/lib/internal/domexception.js @@ -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],