<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Some tests fail with ES6 `u` (Unicode) flag for regular expressions"
   href="https://bugs.webkit.org/show_bug.cgi?id=151597#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Some tests fail with ES6 `u` (Unicode) flag for regular expressions"
   href="https://bugs.webkit.org/show_bug.cgi?id=151597">bug 151597</a>
              from <span class="vcard"><a class="email" href="mailto:msaboff&#64;apple.com" title="Michael Saboff &lt;msaboff&#64;apple.com&gt;"> <span class="fn">Michael Saboff</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=151597#c2">comment #2</a>)
<span class="quote">&gt; Seems like this has been implemented in Safari Technology Preview v9.1.1
&gt; (11601.6.10, 11602.1.25).
&gt; 
&gt; However, the implementation is buggy:
&gt; <a href="http://mathias.html5.org/tests/javascript/regexp/">http://mathias.html5.org/tests/javascript/regexp/</a>
&gt; 
&gt; The following tests fail:
&gt; 
&gt;     assert_equals(/𝌆{2}/u.test('𝌆𝌆'), true);
&gt;     assert_equals(/\uD834\uDF06{2}/u.test('\uD834\uDF06\uD834\uDF06'), true);</span >

These two tests point out bug in quantified unicode regular expression processing.

<span class="quote">&gt;     assert_equals(/\W/iu.test('S'), true);
&gt;     assert_equals(/\W/iu.test('K'), true);</span >

According the CharacterClassEscape pattern semantic rules specified in the ES6 spec section 21.2.2.12 (<a href="https://tc39.github.io/ecma262/2016/#sec-characterclassescape">https://tc39.github.io/ecma262/2016/#sec-characterclassescape</a>) along with the canonicalization rules found at 21.2.2.8.2 (<a href="https://tc39.github.io/ecma262/2016/#sec-runtime-semantics-canonicalize-ch">https://tc39.github.io/ecma262/2016/#sec-runtime-semantics-canonicalize-ch</a>), upper case ASCII 'S' and 'K' ARE word characters and therefore should fail with the non-word, \W, character class.  This also holds true for when the ignore case flag is provided.

Note that the Chrome team believes that the current Chrome canary (51.0.2692.0 canary) incorrectly handles these two test cases.  This Chrome issue is tracked in <a href="https://bugs.chromium.org/p/v8/issues/detail?id=4879">https://bugs.chromium.org/p/v8/issues/detail?id=4879</a>.

<span class="quote">&gt; Please fix this before shipping this in a stable release to avoid
&gt; compatibility problems.</span >

I created a new bug (<a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - [ES6] Quantified unicode regular expressions do not work for counts greater than 1"
   href="show_bug.cgi?id=156044">https://bugs.webkit.org/show_bug.cgi?id=156044</a>) to track just the quantified unicode RegExp test failures.</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>