DevTools: Replace camel case variable names (#32726)

* refactor: rename to snake case

* refactor: more renaming

* chore: format

* chore: clean
This commit is contained in:
eri 2024-07-08 13:18:35 +02:00 committed by GitHub
parent b243457ccc
commit 2888193cfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 363 additions and 323 deletions

View file

@ -37,10 +37,10 @@ impl Console {
unsafe { describe_scripted_caller(*GlobalScope::get_cx()) }.unwrap_or_default();
let console_message = ConsoleMessage {
message,
logLevel: level,
log_level: level,
filename: caller.filename,
lineNumber: caller.line as usize,
columnNumber: caller.col as usize,
line_number: caller.line as usize,
column_number: caller.col as usize,
};
let worker_id = global
.downcast::<WorkerGlobalScope>()

View file

@ -2299,13 +2299,13 @@ impl GlobalScope {
self.pipeline_id,
PageError {
type_: "PageError".to_string(),
errorMessage: warning.to_string(),
sourceName: self.get_url().to_string(),
lineText: "".to_string(),
lineNumber: 0,
columnNumber: 0,
error_message: warning.to_string(),
source_name: self.get_url().to_string(),
line_text: "".to_string(),
line_number: 0,
column_number: 0,
category: "script".to_string(),
timeStamp: 0, //TODO
time_stamp: 0, //TODO
error: false,
warning: true,
exception: true,
@ -2487,13 +2487,13 @@ impl GlobalScope {
self.pipeline_id,
PageError {
type_: "PageError".to_string(),
errorMessage: error_info.message.clone(),
sourceName: error_info.filename.clone(),
lineText: "".to_string(), //TODO
lineNumber: error_info.lineno,
columnNumber: error_info.column,
error_message: error_info.message.clone(),
source_name: error_info.filename.clone(),
line_text: "".to_string(), //TODO
line_number: error_info.lineno,
column_number: error_info.column,
category: "script".to_string(),
timeStamp: 0, //TODO
time_stamp: 0, //TODO
error: true,
warning: false,
exception: true,

View file

@ -1114,29 +1114,29 @@ impl Node {
pub fn summarize(&self) -> NodeInfo {
let USVString(base_uri) = self.BaseURI();
NodeInfo {
uniqueId: self.unique_id(),
baseURI: base_uri,
unique_id: self.unique_id(),
base_uri,
parent: self
.GetParentNode()
.map_or("".to_owned(), |node| node.unique_id()),
nodeType: self.NodeType(),
namespaceURI: String::new(), //FIXME
nodeName: String::from(self.NodeName()),
numChildren: self.ChildNodes().Length() as usize,
node_type: self.NodeType(),
namespace_uri: String::new(), //FIXME
node_name: String::from(self.NodeName()),
num_children: self.ChildNodes().Length() as usize,
//FIXME doctype nodes only
name: String::new(),
publicId: String::new(),
systemId: String::new(),
public_id: String::new(),
system_id: String::new(),
attrs: self.downcast().map(Element::summarize).unwrap_or(vec![]),
isDocumentElement: self
is_document_element: self
.owner_doc()
.GetDocumentElement()
.map_or(false, |elem| elem.upcast::<Node>() == self),
shortValue: self.GetNodeValue().map(String::from).unwrap_or_default(), //FIXME: truncate
incompleteValue: false, //FIXME: reflect truncation
short_value: self.GetNodeValue().map(String::from).unwrap_or_default(), //FIXME: truncate
incomplete_value: false, //FIXME: reflect truncation
}
}