No subject


Fri Mar 7 15:32:22 PST 2014


"The value of separator may be an empty String, an empty regular expression, or a regular expression that can match an empty String. In this case, separator does not match the empty substring at the beginning or end of the input String, nor does it match the empty substring at the end of the previous separator match."
In this case, the regexp can only match an empty substring at the end of the input, and by the above text, that match is ignored wrt. splitting, so the result should be the same as with no match, ["a"].

-- 
You are receiving this mail because:
You are the assignee for the bug.
--1414489469.B54aC0.31360
Date: Tue, 28 Oct 2014 02:44:29 -0700
MIME-Version: 1.0
Content-Type: text/html

<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - String.prototype.split gives incorrect result in some cases: &quot;a&quot;.split(/$/) == [&quot;a&quot;,&quot;&quot;] not [&quot;a&quot;]."
   href="https://bugs.webkit.org/show_bug.cgi?id=138129">138129</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>String.prototype.split gives incorrect result in some cases: &quot;a&quot;.split(/$/) == [&quot;a&quot;,&quot;&quot;] not [&quot;a&quot;].
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>528+ (Nightly build)
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>lrn&#64;chromium.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>String.prototype.split gives an incorrect result in some cases.
When doing &quot;a&quot;.split(/$/), the result is [&quot;a&quot;, &quot;&quot;]. The result should be [&quot;a&quot;].
This was seen in Safari 7.1.



More information about the webkit-unassigned mailing list