<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [INTL] Implement the caseFirst option for Intl.Collator"
   href="https://bugs.webkit.org/show_bug.cgi?id=158188#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [INTL] Implement the caseFirst option for Intl.Collator"
   href="https://bugs.webkit.org/show_bug.cgi?id=158188">bug 158188</a>
              from <span class="vcard"><a class="email" href="mailto:sukolsak&#64;gmail.com" title="Sukolsak Sakshuwong &lt;sukolsak&#64;gmail.com&gt;"> <span class="fn">Sukolsak Sakshuwong</span></a>
</span></b>
        <pre>Thanks.

(In reply to <a href="show_bug.cgi?id=158188#c5">comment #5</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=280100&amp;action=diff" name="attach_280100" title="Patch">attachment 280100</a> <a href="attachment.cgi?id=280100&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=280100&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=280100&amp;action=review</a>
&gt; 
&gt; &gt; Source/JavaScriptCore/runtime/IntlCollator.cpp:289
&gt; &gt;      m_numeric = (result.get(ASCIILiteral(&quot;kn&quot;)) == &quot;true&quot;);
&gt; 
&gt; I’d like how this reads better without the parentheses.</span >

Will fix.

<span class="quote">&gt; &gt; Source/JavaScriptCore/runtime/IntlCollator.cpp:290
&gt; &gt; +    const String&amp; caseFirst = result.get(ASCIILiteral(&quot;kf&quot;));
&gt; 
&gt; As with the cases below, I think it’s nicer to have the translation from
&gt; string to CaseFirst be in a helper function. It can be inlined if we like.</span >

Will do. Do you have any name suggestion for the helper function? caseFirstString(CaseFirst) &lt;-&gt; caseFirstFromString(const String&amp;)?

<span class="quote">&gt; &gt; Source/JavaScriptCore/runtime/IntlCollator.cpp:296
&gt; &gt; +        ASSERT(caseFirst == &quot;false&quot;);
&gt; 
&gt; Why can we assert this? What prevents invalid values?</span >

The HashMap &quot;result&quot; which we get the caseFirst value from is sanitized by resolveLocale(...). We test invalid values in the tests.

<span class="quote">&gt; &gt; Source/JavaScriptCore/runtime/IntlCollator.cpp:451
&gt; &gt; +const char* IntlCollator::caseFirstString(CaseFirst caseFirst)
&gt; 
&gt; I think we should probably mark this function inline.</span >

Will do.

<span class="quote">&gt; &gt; Source/JavaScriptCore/runtime/IntlCollator.cpp:462
&gt; &gt; +    return nullptr;
&gt; 
&gt; I think we should return &quot;false&quot; here instead of nullptr.</span >

Why is that? Is it so that the compiler can optimize out the &quot;case CaseFirst::False:&quot; branch?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>