Skip to content

Commit

Permalink
lib: make DOMException attributes configurable and enumerable
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
joyeecheung authored and targos committed Sep 21, 2018
1 parent 5e7b108 commit 0140a98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/internal/domexception.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down

0 comments on commit 0140a98

Please sign in to comment.