Implement console.trace (#34629)

* Include unimplemented console methods in idl file

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix console.assert signature

The condition is optional and there can be multiple messages.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Implement console.trace

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* ./mach fmt

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Log stack trace when calling console.trace

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update wpt expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Include line/column info in console.trace logs

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Move option out of constant

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update mozjs

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2024-12-19 00:45:06 +01:00 committed by GitHub
parent ba56494eec
commit 28e330c9b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 143 additions and 45 deletions

View file

@ -280,6 +280,7 @@ pub enum LogLevel {
Warn,
Error,
Clear,
Trace,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
@ -290,6 +291,21 @@ pub struct ConsoleMessage {
pub filename: String,
pub line_number: usize,
pub column_number: usize,
pub stacktrace: Vec<StackFrame>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct StackFrame {
pub filename: String,
#[serde(rename = "functionName")]
pub function_name: String,
#[serde(rename = "columnNumber")]
pub column_number: u32,
#[serde(rename = "lineNumber")]
pub line_number: u32,
}
bitflags! {
@ -327,7 +343,7 @@ pub struct ConsoleLog {
pub column_number: u32,
pub time_stamp: u64,
pub arguments: Vec<String>,
// pub stacktrace: Vec<...>,
pub stacktrace: Vec<StackFrame>,
}
#[derive(Debug, Deserialize, Serialize)]