LibJS: Port the Identifier AST (and related) nodes to UTF-16

This eliminates quite a lot of UTF-8 / UTF-16 churn.
This commit is contained in:
Timothy Flynn 2025-08-06 11:12:58 -04:00 committed by Tim Flynn
commit b955c9b2a9
Notes: github-actions[bot] 2025-08-13 13:57:20 +00:00
20 changed files with 206 additions and 238 deletions

View file

@ -1361,7 +1361,7 @@ inline Value new_function(VM& vm, FunctionNode const& function_node, Optional<Id
} else {
value = ECMAScriptFunctionObject::create_from_function_node(
function_node,
Utf16FlyString::from_utf8(function_node.name()),
function_node.name(),
*vm.current_realm(),
vm.lexical_environment(),
vm.running_execution_context().private_environment);
@ -1622,9 +1622,8 @@ inline ThrowCompletionOr<ECMAScriptFunctionObject*> new_class(VM& vm, Value supe
if (!class_expression.has_name() && lhs_name.has_value()) {
class_name = interpreter.current_executable().get_identifier(lhs_name.value());
} else {
auto name = Utf16FlyString::from_utf8(class_expression.name());
binding_name = name;
class_name = name;
class_name = class_expression.name();
binding_name = class_name;
}
return TRY(class_expression.create_class_constructor(vm, class_environment, vm.lexical_environment(), super_class, element_keys, binding_name, class_name));