<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [INTL] Implement Collator Compare Functions"
   href="https://bugs.webkit.org/show_bug.cgi?id=147604">bug 147604</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #267384 Flags</td>
           <td>review?
           </td>
           <td>review+
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [INTL] Implement Collator Compare Functions"
   href="https://bugs.webkit.org/show_bug.cgi?id=147604#c23">Comment # 23</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [INTL] Implement Collator Compare Functions"
   href="https://bugs.webkit.org/show_bug.cgi?id=147604">bug 147604</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=267384&amp;action=diff" name="attach_267384" title="Patch">attachment 267384</a> <a href="attachment.cgi?id=267384&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=267384&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=267384&amp;action=review</a>

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlCollator.cpp:277
&gt; +    m_numeric = (result.get(ASCIILiteral(&quot;kn&quot;)) == &quot;true&quot;);</span >

Doesn’t seem to be checking the type for boolean like the pseudocode says we should. Do we have tests covering that?

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlCollator.cpp:336
&gt; +    UColAttributeValue strength;</span >

I suggest initializing this to UCOL_PRIMARY. Would fix a warning on Windows.

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlCollator.cpp:396
&gt; +    UCharIterator iteratorX = createIterator(x);
&gt; +    UCharIterator iteratorY = createIterator(y);</span >

Looks like there is a linking problem on Windows.

     Creating library C:/cygwin/home/buildbot/WebKit/WebKitBuild/Release/lib32/JavaScriptCore.lib and object C:/cygwin/home/buildbot/WebKit/WebKitBuild/Release/lib32/JavaScriptCore.exp
IntlCollator.obj : error LNK2019: unresolved external symbol &quot;struct UCharIterator __cdecl WTF::createIterator(class WTF::StringView)&quot; (?createIterator&#64;WTF&#64;&#64;YA?AUUCharIterator&#64;&#64;VStringView&#64;1&#64;&#64;Z) referenced in function &quot;public: class JSC::JSValue __thiscall JSC::IntlCollator::compareStrings(class JSC::ExecState &amp;,class WTF::StringView,class WTF::StringView)&quot; (?compareStrings&#64;IntlCollator&#64;JSC&#64;&#64;QAE?AVJSValue&#64;2&#64;AAVExecState&#64;2&#64;VStringView&#64;WTF&#64;&#64;1&#64;Z) [C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\Source\JavaScriptCore\JavaScriptCore.vcxproj]

I think this is because the declaration of createIterator in Collator.h needs WTF_EXPORT_PRIVATE.

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlCollator.cpp:397
&gt; +    int result = ucol_strcollIter(m_collator, &amp;iteratorX, &amp;iteratorY, &amp;status);</span >

auto is slightly better than int here

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp:111
&gt; +    if (state-&gt;hadException())
&gt; +        return JSValue::encode(jsUndefined());</span >

We don’t need this code. There is no harm in returning the collator when there’s an exception; the return value will be ignored. It would be better to omit this.

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp:133
&gt; +    if (state-&gt;hadException())
&gt; +        return JSValue::encode(jsUndefined());</span >

We don’t need this code. There is no harm in returning the collator when there’s an exception; the return value will be ignored. It would be better to omit this.

<span class="quote">&gt; Source/JavaScriptCore/runtime/IntlObject.cpp:118
&gt; +    String locale(uloc_getDefault());</span >

We normally prefer the = syntax to the function call style syntax for code like this.</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>