LibWeb/IDB: Dont keep trailing separator when splitting key paths

This commit is contained in:
stelar7 2025-04-25 18:19:05 +02:00 committed by Jelle Raaijmakers
parent 577f799240
commit 47d6b568fd
Notes: github-actions[bot] 2025-04-28 09:32:45 +00:00

View file

@ -917,7 +917,7 @@ WebIDL::ExceptionOr<ErrorOr<JS::Value>> evaluate_key_path_on_a_value(JS::Realm&
// 3. Let identifiers be the result of strictly splitting keyPath on U+002E FULL STOP characters (.).
// 4. For each identifier of identifiers, jump to the appropriate step below:
TRY(key_path_string.bytes_as_string_view().for_each_split_view('.', SplitBehavior::KeepEmpty | SplitBehavior::KeepTrailingSeparator, [&](auto const& identifier) -> ErrorOr<void> {
TRY(key_path_string.bytes_as_string_view().for_each_split_view('.', SplitBehavior::KeepEmpty, [&](auto const& identifier) -> ErrorOr<void> {
// 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.