Skip to content

Clear up Console::internal_warn usages #43091

@Gae24

Description

@Gae24

Noticed this while working on import maps, all Console::internal_warn callers instantiate a DOMString just for it, which will then clone the value. We probably should just use a String and remove the call to clone.

pub(crate) fn internal_warn(global: &GlobalScope, message: DOMString) {
Console::send_string_message(global, ConsoleLogLevel::Warn, String::from(message.clone()));
}

Task:
Change the signature of the Console::internal_warn so that the second argument is a String type and remove the call to clone in the method body. Compilation should show errors at all existing callers to internal_warn that need to be modified. At those call sites, we can directly pass the result of format! to internal_warn instead of passing it to DOMString::from.

Metadata

Metadata

Assignees

Labels

A-content/scriptRelated to the script threadE-less-complexStraightforward. Recommended for a new contributor.I-cleanupNo impact; the issue is one of maintainability or tidiness.good first issueNewcomer-friendly issues.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions