[Webkit-unassigned] [Bug 250903] New: toLocaleLowerCase and toLocaleUpperCase do not throw on empty string
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jan 20 08:58:30 PST 2023
https://bugs.webkit.org/show_bug.cgi?id=250903
Bug ID: 250903
Summary: toLocaleLowerCase and toLocaleUpperCase do not throw
on empty string
Product: WebKit
Version: Safari 16
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
Assignee: webkit-unassigned at lists.webkit.org
Reporter: flackr at chromium.org
Created attachment 464579
--> https://bugs.webkit.org/attachment.cgi?id=464579&action=review
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.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230120/674ec3fa/attachment-0001.htm>
More information about the webkit-unassigned
mailing list