summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-08-27 17:00:54 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-09-20 12:06:54 -0400
commit676bd5f0f4a847429486610c7b4a75803667705f (patch)
tree25d22b6a534f2943e5cb8822d1f6b913212e1948 /lib
parentf91716f5287d6f17ab4543a648f584cdbbdf6170 (diff)
downloadandroid-node-v8-676bd5f0f4a847429486610c7b4a75803667705f.tar.gz
android-node-v8-676bd5f0f4a847429486610c7b4a75803667705f.tar.bz2
android-node-v8-676bd5f0f4a847429486610c7b4a75803667705f.zip
lib: make DOMException attributes configurable and enumerable
The `name`, `message` and `code` attributes of the DOMException interface should be enumerable and configurable. Aligning the definition with the Web allows us to use it when running the Web Platform Tests. Refs: https://heycam.github.io/webidl/#idl-DOMException PR-URL: https://github.com/nodejs/node/pull/22550 Refs: https://github.com/web-platform-tests/wpt/commit/125950d10a346482075c55d27f61a1021ca68d68 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/domexception.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/internal/domexception.js b/lib/internal/domexception.js
index bd2ad958ae..586d954dc4 100644
--- a/lib/internal/domexception.js
+++ b/lib/internal/domexception.js
@@ -44,7 +44,10 @@ class DOMException extends Error {
}
Object.defineProperties(DOMException.prototype, {
- [Symbol.toStringTag]: { configurable: true, value: 'DOMException' }
+ [Symbol.toStringTag]: { configurable: true, value: 'DOMException' },
+ name: { enumerable: true, configurable: true },
+ message: { enumerable: true, configurable: true },
+ code: { enumerable: true, configurable: true }
});
for (const [name, codeName, value] of [