<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>250903</bug_id>
          
          <creation_ts>2023-01-20 08:58:30 -0800</creation_ts>
          <short_desc>toLocaleLowerCase and toLocaleUpperCase do not throw on empty string</short_desc>
          <delta_ts>2023-01-23 14:22:20 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>Safari 16</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Flack">flackr</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>karlcow</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1926919</commentid>
    <comment_count>0</comment_count>
      <attachid>464579</attachid>
    <who name="Robert Flack">flackr</who>
    <bug_when>2023-01-20 08:58:30 -0800</bug_when>
    <thetext>Created attachment 464579
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:
&apos;&apos;.toLocaleLowerCase(&apos;&apos;);
&apos;&apos;.toLocaleUpperCase(&apos;&apos;);

Chrome throws a RangeError for &apos;&apos;.toLocaleUpperCase(&apos;&apos;) and before M109 did for &apos;&apos;.toLocaleLowerCase(&apos;&apos;), 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1927541</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-23 12:22:28 -0800</bug_when>
    <thetext>&lt;rdar://problem/104568214&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1927542</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2023-01-23 12:24:12 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/8986</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1927588</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-01-23 14:22:17 -0800</bug_when>
    <thetext>Committed 259242@main (e99f5f69bf90): &lt;https://commits.webkit.org/259242@main&gt;

Reviewed commits have been landed. Closing PR #8986 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>464579</attachid>
            <date>2023-01-20 08:58:30 -0800</date>
            <delta_ts>2023-01-20 08:58:30 -0800</delta_ts>
            <desc>Demonstrates the error thrown with a string passed and none without.</desc>
            <filename>test-locale.html</filename>
            <type>text/html</type>
            <size>515</size>
            <attacher name="Robert Flack">flackr</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzdHlsZT4KZGl2IHsKICB3aGl0ZS1zcGFjZTogcHJlOwp9Cjwvc3R5
bGU+CjxkaXYgaWQ9ImxvZyI+PC9kaXY+CjxzY3JpcHQ+CmZ1bmN0aW9uIHRlc3QocykgewogIGxl
dCBlbCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdsb2cnKTsKICBsZXQgcmVzdWx0ID0gYFRl
c3QgJHtzfTogYDsKICB0cnkgewogICAgcmVzdWx0ICs9IGV2YWwocyk7CiAgfSBjYXRjaCAoZSkg
ewogICAgcmVzdWx0ICs9IGUudG9TdHJpbmcoKTsKICB9CiAgZWwudGV4dENvbnRlbnQgKz0gcmVz
dWx0ICsgJ1xuJzsKfQoKZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignRE9NQ29udGVudExvYWRl
ZCcsICgpID0+IHsgCiAgdGVzdCgiJ2EnLnRvTG9jYWxlTG93ZXJDYXNlKCcnKSIpOwogIHRlc3Qo
IidhJy50b0xvY2FsZVVwcGVyQ2FzZSgnJykiKTsKICB0ZXN0KCInJy50b0xvY2FsZUxvd2VyQ2Fz
ZSgnJykiKTsKICB0ZXN0KCInJy50b0xvY2FsZVVwcGVyQ2FzZSgnJykiKTsKfSk7Cjwvc2NyaXB0
Pgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>