mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-23 00:19:18 +00:00
LibJS+LibWeb: Port interned bytecode strings to UTF-16
This was almost a no-op, except we intern JS exception messages. So the bulk of this patch is porting exception messages to UTF-16.
This commit is contained in:
parent
cf61171864
commit
70db474cf0
Notes:
github-actions[bot]
2025-08-14 08:28:16 +00:00
Author: https://github.com/trflynn89
Commit: 70db474cf0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5845
Reviewed-by: https://github.com/gmta ✅
162 changed files with 1405 additions and 1422 deletions
|
@ -39,7 +39,7 @@ GC::Ref<Error> Error::create(Realm& realm)
|
|||
return realm.create<Error>(realm.intrinsics().error_prototype());
|
||||
}
|
||||
|
||||
GC::Ref<Error> Error::create(Realm& realm, String message)
|
||||
GC::Ref<Error> Error::create(Realm& realm, Utf16String message)
|
||||
{
|
||||
auto error = Error::create(realm);
|
||||
error->set_message(move(message));
|
||||
|
@ -48,7 +48,7 @@ GC::Ref<Error> Error::create(Realm& realm, String message)
|
|||
|
||||
GC::Ref<Error> Error::create(Realm& realm, StringView message)
|
||||
{
|
||||
return create(realm, MUST(String::from_utf8(message)));
|
||||
return create(realm, Utf16String::from_utf8(message));
|
||||
}
|
||||
|
||||
Error::Error(Object& prototype)
|
||||
|
@ -75,7 +75,7 @@ ThrowCompletionOr<void> Error::install_error_cause(Value options)
|
|||
return {};
|
||||
}
|
||||
|
||||
void Error::set_message(String message)
|
||||
void Error::set_message(Utf16String message)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
|
||||
|
@ -169,7 +169,7 @@ String Error::stack_string(CompactTraceback compact) const
|
|||
return realm.create<ClassName>(realm.intrinsics().snake_name##_prototype()); \
|
||||
} \
|
||||
\
|
||||
GC::Ref<ClassName> ClassName::create(Realm& realm, String message) \
|
||||
GC::Ref<ClassName> ClassName::create(Realm& realm, Utf16String message) \
|
||||
{ \
|
||||
auto error = ClassName::create(realm); \
|
||||
error->set_message(move(message)); \
|
||||
|
@ -178,7 +178,7 @@ String Error::stack_string(CompactTraceback compact) const
|
|||
\
|
||||
GC::Ref<ClassName> ClassName::create(Realm& realm, StringView message) \
|
||||
{ \
|
||||
return create(realm, MUST(String::from_utf8(message))); \
|
||||
return create(realm, Utf16String::from_utf8(message)); \
|
||||
} \
|
||||
\
|
||||
ClassName::ClassName(Object& prototype) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue