WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
250903
toLocaleLowerCase and toLocaleUpperCase do not throw on empty string
https://bugs.webkit.org/show_bug.cgi?id=250903
Summary
toLocaleLowerCase and toLocaleUpperCase do not throw on empty string
Robert Flack
Reported
2023-01-20 08:58:30 PST
Created
attachment 464579
[details]
Demonstrates the error thrown with a string passed and none without. I believe by spec toLocaleLowerCase / toLocaleUpperCase are required to throw a RangeError if you specify an invalid locale per section 9.2.1 CanicalizeLocaleList with the exception thrown in step 7.c.v (
https://tc39.es/ecma402/#sec-canonicalizelocalelist
) Firefox throws a RangeError for both of the following: ''.toLocaleLowerCase(''); ''.toLocaleUpperCase(''); Chrome throws a RangeError for ''.toLocaleUpperCase('') and before M109 did for ''.toLocaleLowerCase(''), the lack of error for lowercase is tracked as
https://crbug.com/1409058
Safari does not throw an error if the string being converted is empty, but does if you have a non-empty string being converted.
Attachments
Demonstrates the error thrown with a string passed and none without.
(515 bytes, text/html)
2023-01-20 08:58 PST
,
Robert Flack
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-01-23 12:22:28 PST
<
rdar://problem/104568214
>
Yusuke Suzuki
Comment 2
2023-01-23 12:24:12 PST
Pull request:
https://github.com/WebKit/WebKit/pull/8986
EWS
Comment 3
2023-01-23 14:22:17 PST
Committed
259242@main
(e99f5f69bf90): <
https://commits.webkit.org/259242@main
> Reviewed commits have been landed. Closing PR #8986 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug