зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1390170 - DOMException.prototype should have .message and .name r=bkelly
The spec requires that they be interface members: https://heycam.github.io/webidl/#idl-DOMException This means they're on the prototype. This change brings us in line with Chrome, Edge, and WebKit, as tested by <https://github.com/w3c/web-platform-tests/pull/6875>. MozReview-Commit-ID: A1cKpmlCNCs --HG-- extra : rebase_source : 1bce93cdb44fe6718289a86314bbe8ab4afea6ed
This commit is contained in:
Родитель
ad97051e47
Коммит
11e2c13fc6
|
@ -19,12 +19,8 @@ interface StackFrame;
|
|||
Exposed=(Window,Worker)]
|
||||
interface ExceptionMembers
|
||||
{
|
||||
// A custom message set by the thrower.
|
||||
readonly attribute DOMString message;
|
||||
// The nsresult associated with this exception.
|
||||
readonly attribute unsigned long result;
|
||||
// The name of the error code (ie, a string repr of |result|).
|
||||
readonly attribute DOMString name;
|
||||
|
||||
// Filename location. This is the location that caused the
|
||||
// error, which may or may not be a source file location.
|
||||
|
@ -57,6 +53,10 @@ interface ExceptionMembers
|
|||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface Exception {
|
||||
// The name of the error code (ie, a string repr of |result|).
|
||||
readonly attribute DOMString name;
|
||||
// A custom message set by the thrower.
|
||||
readonly attribute DOMString message;
|
||||
// A generic formatter - make it suitable to print, etc.
|
||||
stringifier;
|
||||
};
|
||||
|
@ -69,6 +69,12 @@ Exception implements ExceptionMembers;
|
|||
Exposed=(Window, Worker),
|
||||
Constructor(optional DOMString message = "", optional DOMString name)]
|
||||
interface DOMException {
|
||||
// The name of the error code (ie, a string repr of |result|).
|
||||
readonly attribute DOMString name;
|
||||
// A custom message set by the thrower.
|
||||
readonly attribute DOMString message;
|
||||
readonly attribute unsigned short code;
|
||||
|
||||
const unsigned short INDEX_SIZE_ERR = 1;
|
||||
const unsigned short DOMSTRING_SIZE_ERR = 2; // historical
|
||||
const unsigned short HIERARCHY_REQUEST_ERR = 3;
|
||||
|
@ -94,8 +100,6 @@ interface DOMException {
|
|||
const unsigned short TIMEOUT_ERR = 23;
|
||||
const unsigned short INVALID_NODE_TYPE_ERR = 24;
|
||||
const unsigned short DATA_CLONE_ERR = 25;
|
||||
|
||||
readonly attribute unsigned short code;
|
||||
};
|
||||
|
||||
// XXXkhuey copy all of Gecko's non-standard stuff onto DOMException, but leave
|
||||
|
|
Загрузка…
Ссылка в новой задаче