Re: [w3c/webpayments-method-identifiers] If URL parsing fails then always fail to match URLs. (#31)

marcoscaceres requested changes on this pull request.

This doesn't address the problems that @annevk outlined. We need an actual algorithm that performs the validation and throws a TypeError on validation failure. 

I'll draft an alternative. 

> @@ -200,16 +200,18 @@
           <li>Let <em>urlA</em> be the result from the <a>URL parser</a> when
           parsing <em>A</em> with no <a>base URL</a>.
           </li>
-          <li>If either <em>urlA.query</em> or <em>urlA.fragment</em> are not
-          <em>null</em> terminate the algorithm with a result of <em>no
-          match</em> and discard <em>A</em> from further matching.
+          <li>If the <a>URL parser</a> throws or if either <em>urlA.query</em>

Note that `.query` makes it look like there is an attribute "query" for the URL object - but there is not. We should link to the appropriate concept here. Otherwise, if you want to use the attributes, then this needs to change to ".search" (and check for "not the empty string"). 

I'd prefer we link to the concepts. 

> @@ -200,16 +200,18 @@
           <li>Let <em>urlA</em> be the result from the <a>URL parser</a> when
           parsing <em>A</em> with no <a>base URL</a>.
           </li>
-          <li>If either <em>urlA.query</em> or <em>urlA.fragment</em> are not
-          <em>null</em> terminate the algorithm with a result of <em>no
-          match</em> and discard <em>A</em> from further matching.
+          <li>If the <a>URL parser</a> throws or if either <em>urlA.query</em>
+          or <em>urlA.fragment</em> are not <em>null</em> terminate the
+          algorithm with a result of <em>no match</em> and discard <em>A</em>

Can we just return false instead of "no match"?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webpayments-method-identifiers/pull/31#pullrequestreview-35007589

Received on Thursday, 27 April 2017 03:47:53 UTC