Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateWith accepts a details object? #657

Closed
jdalton opened this issue Dec 8, 2017 · 2 comments
Closed

updateWith accepts a details object? #657

jdalton opened this issue Dec 8, 2017 · 2 comments

Comments

@jdalton
Copy link
Member

jdalton commented Dec 8, 2017

I noticed the doc note here (or here):

If a developer wants to update the payment request, then they need to call updateWith() and provide a PaymentDetailsUpdate dictionary, or a promise for one, containing changed values that the user agent presents to the user.

The bit that's interesting is the a developer may provide a PaymentDetailsUpdate dictionary object (so not a promise) but the IDL and the spec steps describe only the detailsPromise.

Google dev docs show updateWith accepting a vanilla object too (here and here).
And Google's implementation appears to accept vanilla objects too.

Does the spec text need to be updated or am I missing something?

@romandev
Copy link
Member

romandev commented Dec 8, 2017

This case can be helpful to you. (w3c/ServiceWorker#724)

@marcoscaceres
Copy link
Member

Just to clarify further on @romandev's comment, WebIDL autowraps parameters of promise-accepting methods: so updateWith(details) and updateWith(Promise.resolve(details)) are, from a developer perspective, equivalent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants