Skip to content

behavior for update without any parameters #52

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

Closed
frehner opened this issue Mar 1, 2021 · 2 comments
Closed

behavior for update without any parameters #52

frehner opened this issue Mar 1, 2021 · 2 comments

Comments

@frehner
Copy link

frehner commented Mar 1, 2021

Hopefully an easier question: if I'm reading the WebIDL definition correctly, you could potentially call appHistory.update() without any parameters, correct? (Also note that the definition for update appears to match push exactly, and it is explicitly stated that push can be called without a parameter)

Promise<undefined> update(USVString url, optional AppHistoryEntryOptions options = {});
Promise<undefined> update(optional AppHistoryEntryFullOptions options = {});
Promise<undefined> update(AppHistoryNavigationCallback);

In this case, what is the expected behavior of appHistory.update() (regarding updates to url and/or state, as well as event listeners)?

@domenic
Copy link
Collaborator

domenic commented Mar 1, 2021

Great question. I could swear I disallowed this at one point, but not recently at least...

I think the only sensible option would be for it to do nothing, so probably it's better for it just to throw.

@domenic
Copy link
Collaborator

domenic commented Mar 2, 2021

Oh, I remember the issue now. Web IDL enforces a rule that any trailing dictionaries with non-required members be marked optional. This works poorly for cases like this, where we want to require "the dictionary must contain at least one value". That has to be specified in prose, not IDL. See whatwg/webidl#903.

I'll add a comment to the IDL to remind us of this, and it'll become much clearer when it's fully specced.

@domenic domenic closed this as completed in b2e3052 Mar 2, 2021
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

2 participants