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

Always include stacktrace for console messages #854

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -11029,17 +11029,14 @@ Define the following [=console steps=] with |method|, |args|, and

1. Let |source| be the result of [=get the source=] given [=current Realm Record=].

1. If |method| is "<code>assert</code>", "<code>error</code>",
"<code>trace</code>", or "<code>warn</code>", let |stack| be the [=current
stack trace=]. Otherwise let |stack| be null.
1. Let |stack| be the [=current stack trace=].
Copy link
Contributor

Choose a reason for hiding this comment

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

With this change stack can't be null so we can simplify the next step:

the stackTrace field set to |stack| if |stack| is not null, or
omitted otherwise,

can become

the stackTrace field set to |stack|

Also I think stackTrace is now mandatory in log.BaseLogEntry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess GenericLogEntry can still be without stack? (it does not seem to be used but maybe reserved for other kinds of entries?)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yes indeed. A bit weird to have an unused / undefined log type here, but that's another topic :)

Thanks for the patch and sorry about the delay


1. Let |entry| be a [=/map=] matching the <code>log.ConsoleLogEntry</code> production,
with the the <code>level</code> field set to |level|, the <code>text</code>
field set to |text|, the <code>timestamp</code> field set to |timestamp|, the
<code>stackTrace</code> field set to |stack| if |stack| is not null, or
omitted otherwise, the |method| field set to |method|, the <code>source</code>
field set to |source| and the <code>args</code> field set to |serialized
args|.
<code>stackTrace</code> field set to |stack|, the |method| field set to |method|,
the <code>source</code> field set to |source|,
and the <code>args</code> field set to |serialized args|.

1. Let |body| be a [=/map=] matching the <code>log.EntryAdded</code> production, with
the <code>params</code> field set to |entry|.
Expand Down