Skip to content

Commit 0140a98

Browse files
joyeecheungtargos
authored andcommitted
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: #22550 Refs: web-platform-tests/wpt@125950d Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 5e7b108 commit 0140a98

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/internal/domexception.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ class DOMException extends Error {
4444
}
4545

4646
Object.defineProperties(DOMException.prototype, {
47-
[Symbol.toStringTag]: { configurable: true, value: 'DOMException' }
47+
[Symbol.toStringTag]: { configurable: true, value: 'DOMException' },
48+
name: { enumerable: true, configurable: true },
49+
message: { enumerable: true, configurable: true },
50+
code: { enumerable: true, configurable: true }
4851
});
4952

5053
for (const [name, codeName, value] of [

0 commit comments

Comments
 (0)