mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
LibJS: Add and use PrimitiveString::length_in_utf16_code_units
I was investigating an optimization in this area, and while it didn't seem to have a noticable improvement, it still seems useful to apply this change.
This commit is contained in:
parent
560317b3d0
commit
e476d21ed0
Notes:
github-actions[bot]
2025-05-03 14:19:42 +00:00
Author: https://github.com/shannonbooth
Commit: e476d21ed0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4571
5 changed files with 12 additions and 9 deletions
|
@ -921,7 +921,7 @@ WebIDL::ExceptionOr<ErrorOr<JS::Value>> evaluate_key_path_on_a_value(JS::Realm&
|
|||
// If Type(value) is String, and identifier is "length"
|
||||
if (value.is_string() && identifier == "length") {
|
||||
// Let value be a Number equal to the number of elements in value.
|
||||
value = JS::Value(value.as_string().utf16_string_view().length_in_code_units());
|
||||
value = JS::Value(value.as_string().length_in_utf16_code_units());
|
||||
}
|
||||
|
||||
// If value is an Array and identifier is "length"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue