Skip to content

Specify console.context #244

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

nchevobbe
Copy link

@nchevobbe nchevobbe commented May 26, 2025

This specifies the console.context(label) method which returns a new console namespace object with an optional context name label.

Tests: TODO

Fixes #193



Preview | Diff

This specifies the console.context(label) method which
returns a new console namespace object with an optional
context name label.

Tests: TBD

Fixes whatwg#193
Copy link
Author

@nchevobbe nchevobbe left a comment

Choose a reason for hiding this comment

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

Note that this is the first time I'm writing such spec PR and I could be doing things the wrong way.

@@ -83,6 +83,9 @@ namespace console { // but see namespace object requirements below
undefined time(optional DOMString label = "default");
undefined timeLog(optional DOMString label = "default", any... data);
undefined timeEnd(optional DOMString label = "default");

// Contextualizing
Copy link
Author

Choose a reason for hiding this comment

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

I don't really like this name, but couldn't find anything that would suit this. Maybe we don't need a "section" comment here? I was trying to replicate what was already there

@@ -291,6 +294,18 @@ for plans to make {{console/timeEnd()}} and {{console/timeLog()}} formally repor
console when a given |label| does not exist in the associated <a>timer table</a>.
</p>

<h3 id="contextualizing">Contextualizing</h3>
Copy link
Author

Choose a reason for hiding this comment

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

Again, not convinced about this name

@@ -291,6 +294,18 @@ for plans to make {{console/timeEnd()}} and {{console/timeLog()}} formally repor
console when a given |label| does not exist in the associated <a>timer table</a>.
</p>

<h3 id="contextualizing">Contextualizing</h3>

Each {{console}} namespace object has an associated <dfn>context name</dfn>, empty by default.
Copy link
Author

Choose a reason for hiding this comment

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

Not sure if we should have an example here, or indicate that the context name could be consumed in the UI (for display/filtering)

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

These are drive-by comments. I don't have enough context to do a full review.

@nchevobbe
Copy link
Author

These are drive-by comments. I don't have enough context to do a full review.

Thanks! I included your suggestions 👍

@nchevobbe
Copy link
Author

looks like I overlooked what a namespace object is, and I don't think it can be what is returned from console.context() here. So I guess it should return some kind of Console/Context/ConsoleInstance interface, that hopefully we can then reuse for the definition of the console namespace?

@nchevobbe nchevobbe marked this pull request as draft May 27, 2025 13:09
@nchevobbe nchevobbe changed the title [WIP] Specify console.context Specify console.context May 27, 2025
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.

console.context()
2 participants