<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Refactor compareIterations to remove duplicate code."
   href="https://bugs.webkit.org/show_bug.cgi?id=152913#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Refactor compareIterations to remove duplicate code."
   href="https://bugs.webkit.org/show_bug.cgi?id=152913">bug 152913</a>
              from <span class="vcard"><a class="email" href="mailto:jmarcell&#64;apple.com" title="Jason Marcell &lt;jmarcell&#64;apple.com&gt;"> <span class="fn">Jason Marcell</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=268981&amp;action=diff" name="attach_268981" title="Patch">attachment 268981</a> <a href="attachment.cgi?id=268981&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt; Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js:69
&gt; +    ok(queue.compareIterations(iteration2, iteration2) === 0, &quot;equal&quot;); // if statement actually falls through</span >

Additional explanation:

My intention for the three groups of &quot;compareIterations&quot; tests was to give full code coverage by forcing the execution path through the three different return statements.

    compareIterations: function(a, b)
    {
        result = this.compareIterationsByRevisions(a, b);
        if (result)
1.          return result;

        // A loaded iteration may not have revision numbers if it failed early, before svn steps finished.
        result = b.loaded - a.loaded;
        if (result)
2.          return result;

3.      return b.id - a.id;
    },

For this particular test we call this.compareIterationsByRevisions and it returns 0, which is falsy, and so we don't actually return via the first return statement -- it falls through.</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>