[paymentrequest] Error types used are weird and excessive (#56)

>  If the length of the supportedMethods sequence is zero, then throw a SyntaxError. 

> If details does not contain a sequence of items with length greater than zero, then throw an InvalidAccessError. 

> If data is not a JSON object, then throw an InvalidAccessError. 

> The name of each top level field of data MUST match a payment method identifier in supportedMethods. The value of each top level field MUST be a JSON object. If this is not the case, then throw an InvalidAccessError. 

These should all just be ES `TypeError`s.

Also, the last of these is phrased weirdly, with "MUST" requirements that are presumably about authoring conformance? Instead it should just do what the other steps do, and be of the "If [invalid stuff happens], throw a TypeError" form.

---
Reply to this email directly or view it on GitHub:
https://github.com/WICG/paymentrequest/issues/56

Received on Thursday, 18 February 2016 22:58:49 UTC