-
Notifications
You must be signed in to change notification settings - Fork 97
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
Control flow for loops #22
Comments
HTML uses labels and "goto", but I guess that doesn't work great with foreach-style loops. |
Not opposed to both. URL has goto too, although rewrites have been requested for many of the same reasons it's avoided everywhere else... |
CSP uses "continue to the next item" in various places (https://w3c.github.io/webappsec-csp/#parse-serialized-policy for example). Since that's the way it's phrased in a variety of programming languages, phrasing it that way in the spec makes sense to me. I'd suggest a template like the following:
|
I like "continue to label". I wonder if we can just use "continue" for the other kind, since there's no real reason to make that phrase more complicated and mentioning the variable there makes it seem like you're passing an argument (which is a thing we do with "return" and "throw" and "continue to"). And maybe we should have break as well?
|
SGTM. |
This patch defines 'continue' and 'break' in the context of a 'for each' loop, and provides simple examples of their usage. This addresses pieces of #22, leaving 'continue to' for a subsequent patch.
See whatwg/infra#22 for context.
See whatwg/infra#22 for context.
It would be great to have a less awkward way of phrasing to run a loop for the next item: https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke. Basically something like "continue".
The text was updated successfully, but these errors were encountered: