mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
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:
Notes:
github-actions[bot]
2025-08-13 13:57:20 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/b955c9b2a91 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5762
@@ -418,9 +418,9 @@ void initialize_main_thread_vm(AgentType type)
|
||||
};
|
||||
|
||||
// 8.1.6.7.2 HostGetSupportedImportAttributes(), https://html.spec.whatwg.org/multipage/webappapis.html#hostgetsupportedimportassertions
|
||||
s_main_thread_vm->host_get_supported_import_attributes = []() -> Vector<String> {
|
||||
s_main_thread_vm->host_get_supported_import_attributes = []() -> Vector<Utf16String> {
|
||||
// 1. Return « "type" ».
|
||||
return { "type"_string };
|
||||
return { "type"_utf16 };
|
||||
};
|
||||
|
||||
// 8.1.6.7.3 HostLoadImportedModule(referrer, moduleRequest, loadState, payload), https://html.spec.whatwg.org/multipage/webappapis.html#hostloadimportedmodule
|
||||
@@ -494,7 +494,7 @@ void initialize_main_thread_vm(AgentType type)
|
||||
|
||||
// 2. Resolve a module specifier given referencingScript and moduleRequest.[[Specifier]], catching any
|
||||
// exceptions. If they throw an exception, let resolutionError be the thrown exception.
|
||||
auto maybe_exception = HTML::resolve_module_specifier(referencing_script, module_request.module_specifier.to_string());
|
||||
auto maybe_exception = HTML::resolve_module_specifier(referencing_script, module_request.module_specifier.view().to_utf8_but_should_be_ported_to_utf16());
|
||||
|
||||
// 3. If the previous step threw an exception, then:
|
||||
if (maybe_exception.is_exception()) {
|
||||
@@ -544,7 +544,7 @@ void initialize_main_thread_vm(AgentType type)
|
||||
|
||||
// 8. Let url be the result of resolving a module specifier given referencingScript and moduleRequest.[[Specifier]],
|
||||
// catching any exceptions. If they throw an exception, let resolutionError be the thrown exception.
|
||||
auto url = HTML::resolve_module_specifier(referencing_script, module_request.module_specifier.to_string());
|
||||
auto url = HTML::resolve_module_specifier(referencing_script, module_request.module_specifier.view().to_utf8_but_should_be_ported_to_utf16());
|
||||
|
||||
// 9. If the previous step threw an exception, then:
|
||||
if (url.is_exception()) {
|
||||
|
||||
Reference in New Issue
Block a user