<?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>32342</bug_id>
          
          <creation_ts>2009-12-09 12:49:06 -0800</creation_ts>
          <short_desc>Javascript string comparison</short_desc>
          <delta_ts>2009-12-09 23:01:07 -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>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>32256</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Matt O">matt</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mjs</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>170121</commentid>
    <comment_count>0</comment_count>
    <who name="Matt O">matt</who>
    <bug_when>2009-12-09 12:49:06 -0800</bug_when>
    <thetext>This broken with the nightly build from Monday, Dec 7.  Javascript appears to be evaluating the following code properly in console until you get to the last line.  The expression is always being evaluated as &quot;true&quot;.

mystring = &quot;02122010&quot;;
digits = mystring.substr(2,2);

console.log(&quot;Digits value:&quot;);
console.log(digits);

console.log(&quot;Digits type:&quot;);
console.log(typeof digits);

console.log(&quot;This expression evaluates correctly as false: (digits &gt; 12)&quot;);
console.log(digits &lt; 1);

console.log(&quot;This expression evaluates correctly as false: (digits &gt; 12)&quot;);
console.log(digits &gt; 12);

console.log(&quot;This expression evaluates correctly as false: (digits &lt; 1) || (digits &gt; 12)&quot;);
console.log((digits &lt; 1) || (digits &gt; 12));

console.log(&quot;But it fails in real use:  if ((digits &lt; 1) || (digits &gt; 12)) { console.log(\&quot;Sorry, I don&apos;t like strings - even though I should.\&quot;); }&quot;)
if ((digits &lt; 1) || (digits &gt; 12)) { console.log(&quot;Sorry, I don&apos;t like strings - even though I should.&quot;); }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>170150</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2009-12-09 13:41:25 -0800</bug_when>
    <thetext>&lt;rdar://problem/7457885&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>170323</commentid>
    <comment_count>2</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2009-12-09 23:01:07 -0800</bug_when>
    <thetext>This is caused by the same underlying bug as bug 32256. Marking duplicate of the higher-numbered bug because the other bug better reflects the impact.

*** This bug has been marked as a duplicate of bug 32256 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>