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

Report warning #151

Merged
merged 5 commits into from
Dec 12, 2018
Merged

Report warning #151

merged 5 commits into from
Dec 12, 2018

Conversation

domfarolino
Copy link
Member

@domfarolino domfarolino commented Nov 24, 2018

Closes #57. Not entirely familiar with creating an exportable definition in Bikeshed, but given some examples in whatwg/dom and friends I take it the export keyword is sufficient for Bikeshed to pick it up?

Also I'm happy to make a ReportWarning(...) abstract operation instead of just a dfn that can be given "a generic warning", but I figured I'd go down this route first.

Edit: #57 mentions it might be good to make this optionally call Printer(...), but personally I prefer to make it mandatory, and have callers optionally call into our definition. I think this will make their specs more clear.

@domenic
Copy link
Member

domenic commented Nov 27, 2018

Overall looks good. Might be able to simplify it; the structure of "This specification defines X... to X, perform the following steps..." is a bit strange. But no immediate better idea.

But, one thing I think should be addressed is to explain how we don't generally specify exact strings. The proposed algorithm gives the impression that you would pass a string.

You could fix this a couple of ways. One would be to explain the above, and maybe add an example of an algorithm that calls this, which says something like

If the foo value is "bar", report a warning to the console saying that "bar" has no effect, and return.

This formulation is basically saying that callers should feed descriptions of message to the algorithm, and not exact strings.

Alternately, you could make this pattern more explicit in the definition of the algorithm, e.g. saying "given a description of a message description", and calling Printer with "some implementation-defined string derived from description".

@terinjokes
Copy link
Collaborator

Agree with @domenic above, this looks mostly good. I also agree that it makes sense to clarify that other specification would be describing something to be logged, not an exact string.

@domfarolino
Copy link
Member Author

the structure of "This specification defines X... to X, perform the following steps..." is a bit strange. But no immediate better idea.

Yeah that makes sense, my main goal was to point out that basically this is something that's "meant" to be consumed by specs other than Console (and is exported), however that is probably obvious from context; for now I removed it.

Ping for re-review!

index.bs Outdated Show resolved Hide resolved
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Also you should update the part of the spec that uses this already to cross-link to it!

optionally reporting a warning to the console indicating that a timer with label label has already been started.

@domfarolino
Copy link
Member Author

I was actually going to do all of that separately as a part of #134, so stay tuned!

@domfarolino domfarolino merged commit b6cca58 into master Dec 12, 2018
@domfarolino domfarolino deleted the report-warning branch December 12, 2018 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants