<?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>20142</bug_id>
          
          <creation_ts>2008-07-23 07:41:15 -0700</creation_ts>
          <short_desc>REGRESSION(r35245): /=/ weirdness</short_desc>
          <delta_ts>2008-07-24 03:17:44 -0700</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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Will Moffat">wdm</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>86729</commentid>
    <comment_count>0</comment_count>
    <who name="Will Moffat">wdm</who>
    <bug_when>2008-07-23 07:41:15 -0700</bug_when>
    <thetext>The regexp /=/ behaves very strangely unless you escape the equals sign. Firefox does not require the escape.


WebKit: 
/=/.toString()  --&gt; &quot;//&quot;   BUG?
/=/.test(&apos;=&apos;)   --&gt; true   ok
&apos;=&apos;.match(/=/)  --&gt; [&quot;&quot;]   BUG?
&apos;=&apos;.match(/\=/) --&gt; [&quot;=&quot;]  ok 

FF3:
/=/.toString()  --&gt; &quot;/=/&quot;  OK
/=/.test(&apos;=&apos;)   --&gt; true   OK
&apos;=&apos;.match(/=/)  --&gt; [&quot;=&quot;]  OK   
&apos;=&apos;.match(/\=/) --&gt; [&quot;=&quot;]  OK</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86731</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-07-23 08:03:28 -0700</bug_when>
    <thetext>Weird. Confirmed as a regression with r35291.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86732</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-07-23 08:38:16 -0700</bug_when>
    <thetext>Regressed between r35231 and r35249, &lt;http://trac.webkit.org/projects/webkit/changeset/35245&gt; is the only suspicious revision in this range.

This is related to the fact that &quot;/=&quot; can be either a beginning of a regexp, or a &quot;divide and assign&quot; operation.  It&apos;s not necessary to escape &apos;=&apos; at positions other than the very beginning of a regexp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86734</commentid>
    <comment_count>3</comment_count>
    <who name="Will Moffat">wdm</who>
    <bug_when>2008-07-23 08:47:02 -0700</bug_when>
    <thetext>To put the bug into context, it breaks all sites which do JsonP using jQuery

http://code.jquery.com/nightlies/jquery-nightly.js (grep for jsre)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86824</commentid>
    <comment_count>4</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2008-07-24 00:38:18 -0700</bug_when>
    <thetext>Ah, whoops, it&apos;s fairly obvious just by looking at the diff, spot the error:
-                                            $$ = createNodeFeatureInfo&lt;ExpressionNode*&gt;(new RegExpNode(GLOBAL_DATA, &quot;=&quot; + l.pattern(), l.flags()), 0);
+                                            RegExpNode* node = new RegExpNode(GLOBAL_DATA, l.pattern(), l.flags());
+                                            int size = l.pattern().size() + 2; // + 2 for the two /&apos;s
+                                            SET_EXCEPTION_LOCATION(node, @1.first_column, @1.first_column + size, @1.first_column + size);
+                                            $$ = createNodeFeatureInfo&lt;ExpressionNode*&gt;(node, 0);

Will fix shortly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86835</commentid>
    <comment_count>5</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2008-07-24 03:17:44 -0700</bug_when>
    <thetext>Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/kjs/grammar.y
	M	LayoutTests/ChangeLog
	A	LayoutTests/fast/js/regexp-divequal-expected.txt
	A	LayoutTests/fast/js/regexp-divequal.html
	A	LayoutTests/fast/js/resources/regexp-divequal.js
Committed r35323</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>