Fix check in get_array_index_from_id to return early on ASCII char (#36136)

* fix: wrong ascii check in get_array_index_from_id

Signed-off-by: Michael Rees <mrees@noeontheend.com>

* Update WPT expectations

Signed-off-by: Michael Rees <mrees@noeontheend.com>

---------

Signed-off-by: Michael Rees <mrees@noeontheend.com>
This commit is contained in:
Michael Rees 2025-03-25 14:27:38 -05:00 committed by GitHub
parent 80fc64d063
commit 09041e77a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1 additions and 13 deletions

View file

@ -196,7 +196,7 @@ pub(crate) unsafe fn get_array_index_from_id(_cx: *mut JSContext, id: HandleId)
let first_char = char::decode_utf16(chars.iter().cloned())
.next()
.map_or('\0', |r| r.unwrap_or('\0'));
if !first_char.is_ascii_lowercase() {
if first_char.is_ascii_lowercase() {
return None;
}

View file

@ -1,10 +1,4 @@
[HTMLCollection-supported-property-indices.html]
[Handling of property names that look like integers around 2^31]
expected: FAIL
[Handling of property names that look like integers around 2^32]
expected: FAIL
[Trying to set an expando that would shadow an already-existing indexed property]
expected: FAIL

View file

@ -1,6 +1,3 @@
[window-indexed-properties-strict.html]
[Indexed properties of the window object (strict mode) 1]
expected: FAIL
[Borderline numeric key: 2 ** 32 - 2 is an index (strict mode)]
expected: FAIL

View file

@ -1,6 +1,3 @@
[window-indexed-properties.html]
[Indexed properties of the window object (non-strict mode) 1]
expected: FAIL
[Borderline numeric key: 2 ** 32 - 2 is an index]
expected: FAIL