Bug 159154

Summary: No error message when passing an invalid API version to ApplePaySession constructor
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, arvind.tech225, commit-queue, michellerodri247, mkwst, writing.my.life4ever
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch thorton: review+

Description Anders Carlsson 2016-06-27 11:04:53 PDT
No error message when passing an invalid API version to ApplePaySession constructor
Comment 1 Anders Carlsson 2016-06-27 11:05:35 PDT
Created attachment 282143 [details]
Patch
Comment 2 Tim Horton 2016-06-27 11:07:05 PDT
Comment on attachment 282143 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=282143&action=review

> Source/WebCore/Modules/applepay/ApplePaySession.cpp:652
> +    if (!version || !paymentCoordinator.supportsVersion(version)) {

Why does supportsVersion not return false for version=0?
Comment 3 Anders Carlsson 2016-06-27 11:26:58 PDT
(In reply to comment #2)
> Comment on attachment 282143 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=282143&action=review
> 
> > Source/WebCore/Modules/applepay/ApplePaySession.cpp:652
> > +    if (!version || !paymentCoordinator.supportsVersion(version)) {
> 
> Why does supportsVersion not return false for version=0?

supportsVersion throws an exception if you pass 0 since it's out of range.
Comment 4 Anders Carlsson 2016-06-27 11:28:19 PDT
Committed r202499: <http://trac.webkit.org/changeset/202499>