From 474d1e7c55190e1ee95435e7e621a493a5bea1b9 Mon Sep 17 00:00:00 2001
From: Marcos Caceres
Date: Wed, 18 Jan 2017 18:52:16 +1100
Subject: [PATCH 1/2] Editorial: use new language for DOMExceptions (close
#375)
---
index.html | 77 +++++++++++++++++++++++++++++++-----------------------
1 file changed, 45 insertions(+), 32 deletions(-)
diff --git a/index.html b/index.html
index 35e23aa5..f8f783d2 100644
--- a/index.html
+++ b/index.html
@@ -356,7 +356,8 @@
If the current settings object's responsible document is not
allowed to use the feature indicated by attribute name
- allowpaymentrequest, then throw a SecurityError.
+ allowpaymentrequest, then throw a
+ "SecurityError" DOMException.
Let parsedMethodData be an empty list.
@@ -606,7 +607,8 @@
which the method is called.
If the value of request.[[\state]] is not
- created then throw an InvalidStateError.
+ created then throw an "InvalidStateError"
+ DOMException.
Set the value of request.[[\state]] to
interactive.
@@ -631,8 +633,8 @@
If this consultation produced no supported method of paying, then
- reject acceptPromise with a NotSupportedError, and
- abort this algorithm.
+ reject acceptPromise with a "NotSupportedError"
+ DOMException, and abort this algorithm.
@@ -683,7 +685,8 @@
which the method is called.
If the value of request.[[\state]] is not
- interactive then throw an InvalidStateError.
+ interactive then throw an "InvalidStateError"
+ DOMException.
Let promise be a new Promise.
@@ -694,14 +697,14 @@
remaining user interface.
If it is not possible to abort the current user interaction, then
- reject promise with InvalidStateError and abort
- this algorithm.
+ reject promise with "InvalidStateError"
+ DOMException and abort this algorithm.
Set the value of the internal slot
request.[[\state]] to closed.
Reject the promise request.[[\acceptPromise]]
- with an AbortError.
+ with an "AbortError" DOMException.
Resolve promise with undefined.
@@ -719,8 +722,8 @@
any of the desired payment methods supplied to the
PaymentRequest constructor, and false if none are supported.
If the method is called too often, the user agent might instead
- return a promise rejected with a QuotaExceededError, at its
- discretion.
+ return a promise rejected with a "QuotaExceededError"
+ DOMException, at its discretion.
The canMakePayment method MUST act as follows:
@@ -730,10 +733,12 @@
which the method was called.
If request.[[\state]] is not created,
- then return a promise rejected with an InvalidStateError.
+ then return a promise rejected with an "InvalidStateError"
+ DOMException.
Optionally, at the user agent's discretion, return a
- promise rejected with a QuotaExceededError.
+ promise rejected with a "QuotaExceededError"
+ DOMException.
This allows user agents to apply heuristics to detect and prevent
abuse of the canMakePayment method for fingerprinting
@@ -1670,7 +1675,8 @@
Let promise be a new Promise.
If the value of the internal slot [[\completeCalled]] is
- true, then throw an InvalidStateError.
+ true, then throw an "InvalidStateError"
+ DOMException.
Set the value of the internal slot [[\completeCalled]] to
true.
@@ -1812,17 +1818,18 @@
If target is not a PaymentRequest
object, then throw a TypeError.
- If the dispatch flag is unset, then throw an
- InvalidStateError.
+ If the dispatch flag is unset, then throw an
+ "InvalidStateError" DOMException.
If [[\waitForUpdate]] is true, then throw an
- InvalidStateError.
+ "InvalidStateError" DOMException.
If target.[[\state]] is not
- interactive, then throw an InvalidStateError.
+ interactive, then throw an "InvalidStateError"
+ DOMException.
If target.[[\updating]] is true, then
- throw an InvalidStateError.
+ throw an "InvalidStateError" DOMException.
Set the stop propagation flag and stop immediate
propagation flag.
@@ -1871,7 +1878,7 @@
Reject the promise
target.[[\acceptPromise]] with an
- AbortError.
+ "AbortError" DOMException.
@@ -2370,8 +2377,9 @@
dispatch flag, stop propagation flag, and
stop immediate propagation flag are defined by [[!DOM4]].
- DOMException and the following DOMException types from
- [[!DOM4]] are used:
+ DOMException
and the
+ following DOMException types from [[!DOM4]] are used:
@@ -2384,7 +2392,8 @@
- AbortError
+ AbortError
|
The payment request was aborted
@@ -2392,7 +2401,8 @@
|
- InvalidStateError
+ InvalidStateError
|
The object is in an invalid state
@@ -2400,7 +2410,8 @@
|
- NotSupportedError
+ NotSupportedError
|
The payment method was not supported
@@ -2408,7 +2419,8 @@
|
- QuotaExceededError
+ QuotaExceededError
|
The
|
- SecurityError
+ SecurityError
|
The operation is only supported in a secure context
@@ -2431,12 +2444,12 @@
Web IDL
- When this specification says to throw an error, the
- user agent must throw an error as described in [[!WEBIDL-2]].
- When this occurs in a sub-algorithm, this results in termination of
- execution of the sub-algorithm and all ancestor algorithms until one
- is reached that explicitly describes procedures for catching
- exceptions.
+ When this specification says to throw an error, the user agent
+ must throw an error as described in [[!WEBIDL-2]]. When this occurs
+ in a sub-algorithm, this results in termination of execution of the
+ sub-algorithm and all ancestor algorithms until one is reached that
+ explicitly describes procedures for catching exceptions.
The term extended attribute is defined by [[!WEBIDL-2]].
From 45365dbfeec00c9ba23dc4f04982bd5c3e273093 Mon Sep 17 00:00:00 2001
From: Marcos Caceres
Date: Thu, 19 Jan 2017 10:01:56 +1100
Subject: [PATCH 2/2] Editorial: relocate exception types to WebIDL deps
---
index.html | 42 ++++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/index.html b/index.html
index f8f783d2..f6f13c5f 100644
--- a/index.html
+++ b/index.html
@@ -2376,10 +2376,31 @@
The Event type and the terms fire an event,
dispatch flag, stop propagation flag, and
stop immediate propagation flag are defined by [[!DOM4]].
+
+
+ Web IDL
+
+
+ When this specification says to throw an error, the user agent
+ must throw an error as described in [[!WEBIDL-2]]. When this occurs
+ in a sub-algorithm, this results in termination of execution of the
+ sub-algorithm and all ancestor algorithms until one is reached that
+ explicitly describes procedures for catching exceptions.
+
+ The term extended attribute is defined by [[!WEBIDL-2]].
+
+
+ The algorithm for converting an ECMAScript value to a
+ dictionary and for converting a dictionary to an
+ ECMAScript value is defined by [[!WEBIDL-2]].
+
+
+
DOMException and the
- following DOMException types from [[!DOM4]] are used:
+ following DOMException types from [[!WEBIDL-2]] are used:
-
- Web IDL
-
-
- When this specification says to throw an error, the user agent
- must throw an error as described in [[!WEBIDL-2]]. When this occurs
- in a sub-algorithm, this results in termination of execution of the
- sub-algorithm and all ancestor algorithms until one is reached that
- explicitly describes procedures for catching exceptions.
-
- The term extended attribute is defined by [[!WEBIDL-2]].
-
-
- The algorithm for converting an ECMAScript value to a
- dictionary and for converting a dictionary to an
- ECMAScript value is defined by [[!WEBIDL-2]].
-
-
Secure Contexts
|