<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199523] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199523">199523</a></dd>
<dt>Author</dt> <dd>msaboff@apple.com</dd>
<dt>Date</dt> <dd>2016-04-13 17:47:40 -0700 (Wed, 13 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Some tests fail with ES6 `u` (Unicode) flag for regular expressions
https://bugs.webkit.org/show_bug.cgi?id=151597

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Added two new tables to handle the anomolies of \w and \W CharacterClassEscapes
when specified in RegExp's with both the unicode and ignoreCase flags.  Given the
case folding rules described in the standard vie the meta function Canonicalize(),
which allow cross ASCII case folding when unicode is specified, the unicode characters
\u017f (small sharp s) and \u212a (kelvin symbol) are part of the \w (word) characterClassEscape.
This is true because they case fold to 's' and 'k' respectively.  Because they case fold
to lower case letters, the corresponding letters, 'k', 'K', 's' and 'S', are also matched with
\W with the unicode and ignoreCase flags.

* create_regex_tables:
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::atomBuiltInCharacterClass):
(JSC::Yarr::YarrPatternConstructor::atomCharacterClassBuiltIn):
(JSC::Yarr::YarrPattern::YarrPattern):
* yarr/YarrPattern.h:
(JSC::Yarr::YarrPattern::wordcharCharacterClass):
(JSC::Yarr::YarrPattern::wordUnicodeIgnoreCaseCharCharacterClass):
(JSC::Yarr::YarrPattern::nonwordcharCharacterClass):
(JSC::Yarr::YarrPattern::nonwordUnicodeIgnoreCaseCharCharacterClass):

LayoutTests:

Updated tests.

* js/regexp-unicode-expected.txt:
* js/script-tests/regexp-unicode.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsregexpunicodeexpectedtxt">trunk/LayoutTests/js/regexp-unicode-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsregexpunicodejs">trunk/LayoutTests/js/script-tests/regexp-unicode.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorecreate_regex_tables">trunk/Source/JavaScriptCore/create_regex_tables</a></li>
<li><a href="#trunkSourceJavaScriptCoreyarrYarrPatterncpp">trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreyarrYarrPatternh">trunk/Source/JavaScriptCore/yarr/YarrPattern.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199522 => 199523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-14 00:42:00 UTC (rev 199522)
+++ trunk/LayoutTests/ChangeLog        2016-04-14 00:47:40 UTC (rev 199523)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-04-13  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        Some tests fail with ES6 `u` (Unicode) flag for regular expressions
+        https://bugs.webkit.org/show_bug.cgi?id=151597
+
+        Reviewed by Geoffrey Garen.
+
+        Updated tests.
+
+        * js/regexp-unicode-expected.txt:
+        * js/script-tests/regexp-unicode.js:
+
</ins><span class="cx"> 2016-04-13  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         We should not speculatively revalidate cached redirects
</span></span></pre></div>
<a id="trunkLayoutTestsjsregexpunicodeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/regexp-unicode-expected.txt (199522 => 199523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regexp-unicode-expected.txt        2016-04-14 00:42:00 UTC (rev 199522)
+++ trunk/LayoutTests/js/regexp-unicode-expected.txt        2016-04-14 00:47:40 UTC (rev 199523)
</span><span class="lines">@@ -39,6 +39,38 @@
</span><span class="cx"> PASS /(?:A|𐄣|b)x/iu.test(&quot;bx&quot;) is true
</span><span class="cx"> PASS &quot;a𐄣X&quot;.match(/a𐄣b|a𐄣x/iu)[0].length is 4
</span><span class="cx"> PASS &quot;Ťx&quot;.match(/ťx/iu)[0].length is 2
</span><ins>+PASS /\w/iu.test(&quot;ſ&quot;) is true
+PASS /\w/iu.test(&quot;K&quot;) is true
+PASS /!\w/iu.test(&quot;ſ&quot;) is false
+PASS /!\w/iu.test(&quot;K&quot;) is false
+PASS /\W/iu.test(&quot;ſ&quot;) is true
+PASS /\W/iu.test(&quot;K&quot;) is true
+PASS /!\W/iu.test(&quot;ſ&quot;) is false
+PASS /!\W/iu.test(&quot;K&quot;) is false
+PASS /[\w\d]/iu.test(&quot;ſ&quot;) is true
+PASS /[\w\d]/iu.test(&quot;K&quot;) is true
+PASS /[^\w\d]/iu.test(&quot;ſ&quot;) is false
+PASS /[^\w\d]/iu.test(&quot;K&quot;) is false
+PASS /[\W\d]/iu.test(&quot;ſ&quot;) is true
+PASS /[\W\d]/iu.test(&quot;K&quot;) is true
+PASS /[^\W\d]/iu.test(&quot;ſ&quot;) is false
+PASS /[^\W\d]/iu.test(&quot;K&quot;) is false
+PASS /\w/iu.test(&quot;S&quot;) is true
+PASS /\w/iu.test(&quot;K&quot;) is true
+PASS /!\w/iu.test(&quot;S&quot;) is false
+PASS /!\w/iu.test(&quot;K&quot;) is false
+PASS /\W/iu.test(&quot;S&quot;) is true
+PASS /\W/iu.test(&quot;K&quot;) is true
+PASS /!\W/iu.test(&quot;S&quot;) is false
+PASS /!\W/iu.test(&quot;K&quot;) is false
+PASS /[\w\d]/iu.test(&quot;S&quot;) is true
+PASS /[\w\d]/iu.test(&quot;K&quot;) is true
+PASS /[^\w\d]/iu.test(&quot;S&quot;) is false
+PASS /[^\w\d]/iu.test(&quot;K&quot;) is false
+PASS /[\W\d]/iu.test(&quot;S&quot;) is true
+PASS /[\W\d]/iu.test(&quot;K&quot;) is true
+PASS /[^\W\d]/iu.test(&quot;S&quot;) is false
+PASS /[^\W\d]/iu.test(&quot;K&quot;) is false
</ins><span class="cx"> PASS &quot;𝌆&quot;.match(/^.$/u)[0].length is 2
</span><span class="cx"> PASS &quot;It is 78°&quot;.match(/.*/u)[0].length is 9
</span><span class="cx"> PASS stringWithDanglingFirstSurrogate.match(/.*/u)[0].length is 3
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsregexpunicodejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/regexp-unicode.js (199522 => 199523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/regexp-unicode.js        2016-04-14 00:42:00 UTC (rev 199522)
+++ trunk/LayoutTests/js/script-tests/regexp-unicode.js        2016-04-14 00:47:40 UTC (rev 199523)
</span><span class="lines">@@ -43,7 +43,40 @@
</span><span class="cx"> shouldBeTrue('/(?:A|\u{10123}|b)x/iu.test(&quot;bx&quot;)');
</span><span class="cx"> shouldBe('&quot;a\u{10123}X&quot;.match(/a\u{10123}b|a\u{10123}x/iu)[0].length', '4');
</span><span class="cx"> shouldBe('&quot;\u0164x&quot;.match(/\u0165x/iu)[0].length', '2');
</span><ins>+shouldBeTrue('/\\w/iu.test(&quot;\u017f&quot;)');
+shouldBeTrue('/\\w/iu.test(&quot;\u212a&quot;)');
+shouldBeFalse('/!\\w/iu.test(&quot;\u017f&quot;)');
+shouldBeFalse('/!\\w/iu.test(&quot;\u212a&quot;)');
+shouldBeTrue('/\\W/iu.test(&quot;\u017f&quot;)');
+shouldBeTrue('/\\W/iu.test(&quot;\u212a&quot;)');
+shouldBeFalse('/!\\W/iu.test(&quot;\u017f&quot;)');
+shouldBeFalse('/!\\W/iu.test(&quot;\u212a&quot;)');
+shouldBeTrue('/[\\w\\d]/iu.test(&quot;\u017f&quot;)');
+shouldBeTrue('/[\\w\\d]/iu.test(&quot;\u212a&quot;)');
+shouldBeFalse('/[^\\w\\d]/iu.test(&quot;\u017f&quot;)');
+shouldBeFalse('/[^\\w\\d]/iu.test(&quot;\u212a&quot;)');
+shouldBeTrue('/[\\W\\d]/iu.test(&quot;\u017f&quot;)');
+shouldBeTrue('/[\\W\\d]/iu.test(&quot;\u212a&quot;)');
+shouldBeFalse('/[^\\W\\d]/iu.test(&quot;\u017f&quot;)');
+shouldBeFalse('/[^\\W\\d]/iu.test(&quot;\u212a&quot;)');
+shouldBeTrue('/\\w/iu.test(&quot;S&quot;)');
+shouldBeTrue('/\\w/iu.test(&quot;K&quot;)');
+shouldBeFalse('/!\\w/iu.test(&quot;S&quot;)');
+shouldBeFalse('/!\\w/iu.test(&quot;K&quot;)');
+shouldBeTrue('/\\W/iu.test(&quot;S&quot;)');
+shouldBeTrue('/\\W/iu.test(&quot;K&quot;)');
+shouldBeFalse('/!\\W/iu.test(&quot;S&quot;)');
+shouldBeFalse('/!\\W/iu.test(&quot;K&quot;)');
+shouldBeTrue('/[\\w\\d]/iu.test(&quot;S&quot;)');
+shouldBeTrue('/[\\w\\d]/iu.test(&quot;K&quot;)');
+shouldBeFalse('/[^\\w\\d]/iu.test(&quot;S&quot;)');
+shouldBeFalse('/[^\\w\\d]/iu.test(&quot;K&quot;)');
+shouldBeTrue('/[\\W\\d]/iu.test(&quot;S&quot;)');
+shouldBeTrue('/[\\W\\d]/iu.test(&quot;K&quot;)');
+shouldBeFalse('/[^\\W\\d]/iu.test(&quot;S&quot;)');
+shouldBeFalse('/[^\\W\\d]/iu.test(&quot;K&quot;)');
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx"> // Test . matches with Unicode flag
</span><span class="cx"> shouldBe('&quot;\u{1D306}&quot;.match(/^.$/u)[0].length', '2');
</span><span class="cx"> shouldBe('&quot;It is 78\u00B0&quot;.match(/.*/u)[0].length', '9');
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (199522 => 199523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-04-14 00:42:00 UTC (rev 199522)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-04-14 00:47:40 UTC (rev 199523)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-04-13  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        Some tests fail with ES6 `u` (Unicode) flag for regular expressions
+        https://bugs.webkit.org/show_bug.cgi?id=151597
+
+        Reviewed by Geoffrey Garen.
+
+        Added two new tables to handle the anomolies of \w and \W CharacterClassEscapes
+        when specified in RegExp's with both the unicode and ignoreCase flags.  Given the
+        case folding rules described in the standard vie the meta function Canonicalize(),
+        which allow cross ASCII case folding when unicode is specified, the unicode characters
+        \u017f (small sharp s) and \u212a (kelvin symbol) are part of the \w (word) characterClassEscape.
+        This is true because they case fold to 's' and 'k' respectively.  Because they case fold
+        to lower case letters, the corresponding letters, 'k', 'K', 's' and 'S', are also matched with
+        \W with the unicode and ignoreCase flags.
+
+        * create_regex_tables:
+        * yarr/YarrPattern.cpp:
+        (JSC::Yarr::YarrPatternConstructor::atomBuiltInCharacterClass):
+        (JSC::Yarr::YarrPatternConstructor::atomCharacterClassBuiltIn):
+        (JSC::Yarr::YarrPattern::YarrPattern):
+        * yarr/YarrPattern.h:
+        (JSC::Yarr::YarrPattern::wordcharCharacterClass):
+        (JSC::Yarr::YarrPattern::wordUnicodeIgnoreCaseCharCharacterClass):
+        (JSC::Yarr::YarrPattern::nonwordcharCharacterClass):
+        (JSC::Yarr::YarrPattern::nonwordUnicodeIgnoreCaseCharCharacterClass):
+
</ins><span class="cx"> 2016-04-13  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r199502 and r199511.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorecreate_regex_tables"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/create_regex_tables (199522 => 199523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/create_regex_tables        2016-04-14 00:42:00 UTC (rev 199522)
+++ trunk/Source/JavaScriptCore/create_regex_tables        2016-04-14 00:47:40 UTC (rev 199523)
</span><span class="lines">@@ -25,12 +25,14 @@
</span><span class="cx"> 
</span><span class="cx"> types = {
</span><span class="cx">     &quot;wordchar&quot;: { &quot;UseTable&quot; : True, &quot;data&quot;: ['_', ('0','9'), ('A', 'Z'), ('a','z')]},
</span><del>-    &quot;nonwordchar&quot;: { &quot;UseTable&quot; : True, &quot;Inverse&quot;: &quot;wordchar&quot;, &quot;data&quot;: ['`', (0, ord('0') - 1), (ord('9') + 1, ord('A') - 1), (ord('Z') + 1, ord('_') - 1), (ord('z') + 1, 0xffff)]},
</del><ins>+    &quot;wordUnicodeIgnoreCaseChar&quot;: { &quot;UseTable&quot; : False, &quot;data&quot;: ['_', ('0', '9'), ('A', 'Z'), ('a', 'z'), 0x017f, 0x212a]},
+    &quot;nonwordchar&quot;: { &quot;UseTable&quot; : True, &quot;Inverse&quot;: &quot;wordchar&quot;, &quot;data&quot;: ['`', (0, ord('0') - 1), (ord('9') + 1, ord('A') - 1), (ord('Z') + 1, ord('_') - 1), (ord('z') + 1, 0x10ffff)]},
+    &quot;nonwordUnicodeIgnoreCaseChar&quot;: { &quot;UseTable&quot; : False, &quot;Inverse&quot;: &quot;wordchar&quot;, &quot;data&quot;: ['k', 'K', 's', 'S', '`', (0, ord('0') - 1), (ord('9') + 1, ord('A') - 1), (ord('Z') + 1, ord('_') - 1), (ord('z') + 1, 0x10ffff)]},
</ins><span class="cx">     &quot;newline&quot;: { &quot;UseTable&quot; : False, &quot;data&quot;: ['\n', '\r', 0x2028, 0x2029]},
</span><span class="cx">     &quot;spaces&quot;: { &quot;UseTable&quot; : True, &quot;data&quot;: [' ', ('\t', '\r'), 0xa0, 0x1680, 0x180e, 0x2028, 0x2029, 0x202f, 0x205f, 0x3000, (0x2000, 0x200a), 0xfeff]},
</span><del>-    &quot;nonspaces&quot;: { &quot;UseTable&quot; : True, &quot;Inverse&quot;: &quot;spaces&quot;, &quot;data&quot;: [(0, ord('\t') - 1), (ord('\r') + 1, ord(' ') - 1), (ord(' ') + 1, 0x009f), (0x00a1, 0x167f), (0x1681, 0x180d), (0x180f, 0x1fff), (0x200b, 0x2027), (0x202a, 0x202e), (0x2030, 0x205e), (0x2060, 0x2fff), (0x3001, 0xfefe), (0xff00, 0xffff)]},
</del><ins>+    &quot;nonspaces&quot;: { &quot;UseTable&quot; : True, &quot;Inverse&quot;: &quot;spaces&quot;, &quot;data&quot;: [(0, ord('\t') - 1), (ord('\r') + 1, ord(' ') - 1), (ord(' ') + 1, 0x009f), (0x00a1, 0x167f), (0x1681, 0x180d), (0x180f, 0x1fff), (0x200b, 0x2027), (0x202a, 0x202e), (0x2030, 0x205e), (0x2060, 0x2fff), (0x3001, 0xfefe), (0xff00, 0x10ffff)]},
</ins><span class="cx">     &quot;digits&quot;: { &quot;UseTable&quot; : False, &quot;data&quot;: [('0', '9')]},
</span><del>-    &quot;nondigits&quot;: { &quot;UseTable&quot; : False, &quot;Inverse&quot;: &quot;digits&quot;, &quot;data&quot;: [(0, ord('0') - 1), (ord('9') + 1, 0xffff)] }
</del><ins>+    &quot;nondigits&quot;: { &quot;UseTable&quot; : False, &quot;Inverse&quot;: &quot;digits&quot;, &quot;data&quot;: [(0, ord('0') - 1), (ord('9') + 1, 0x10ffff)] }
</ins><span class="cx"> }
</span><span class="cx"> entriesPerLine = 50
</span><span class="cx"> arrays = &quot;&quot;;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreyarrYarrPatterncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp (199522 => 199523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp        2016-04-14 00:42:00 UTC (rev 199522)
+++ trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp        2016-04-14 00:47:40 UTC (rev 199523)
</span><span class="lines">@@ -349,7 +349,13 @@
</span><span class="cx">             m_alternative-&gt;m_terms.append(PatternTerm(m_pattern.spacesCharacterClass(), invert));
</span><span class="cx">             break;
</span><span class="cx">         case WordClassID:
</span><del>-            m_alternative-&gt;m_terms.append(PatternTerm(m_pattern.wordcharCharacterClass(), invert));
</del><ins>+            if (m_pattern.unicode() &amp;&amp; m_pattern.ignoreCase()) {
+                if (invert)
+                    m_alternative-&gt;m_terms.append(PatternTerm(m_pattern.nonwordUnicodeIgnoreCaseCharCharacterClass(), false));
+                else
+                    m_alternative-&gt;m_terms.append(PatternTerm(m_pattern.wordUnicodeIgnoreCaseCharCharacterClass(), false));
+            } else
+                m_alternative-&gt;m_terms.append(PatternTerm(m_pattern.wordcharCharacterClass(), invert));
</ins><span class="cx">             break;
</span><span class="cx">         case NewlineClassID:
</span><span class="cx">             m_alternative-&gt;m_terms.append(PatternTerm(m_pattern.newlineCharacterClass(), invert));
</span><span class="lines">@@ -386,7 +392,10 @@
</span><span class="cx">             break;
</span><span class="cx">         
</span><span class="cx">         case WordClassID:
</span><del>-            m_characterClassConstructor.append(invert ? m_pattern.nonwordcharCharacterClass() : m_pattern.wordcharCharacterClass());
</del><ins>+            if (m_pattern.unicode() &amp;&amp; m_pattern.ignoreCase())
+                m_characterClassConstructor.append(invert ? m_pattern.nonwordUnicodeIgnoreCaseCharCharacterClass() : m_pattern.wordUnicodeIgnoreCaseCharCharacterClass());
+            else
+                m_characterClassConstructor.append(invert ? m_pattern.nonwordcharCharacterClass() : m_pattern.wordcharCharacterClass());
</ins><span class="cx">             break;
</span><span class="cx">         
</span><span class="cx">         default:
</span><span class="lines">@@ -884,9 +893,11 @@
</span><span class="cx">     , digitsCached(0)
</span><span class="cx">     , spacesCached(0)
</span><span class="cx">     , wordcharCached(0)
</span><ins>+    , wordUnicodeIgnoreCaseCharCached(0)
</ins><span class="cx">     , nondigitsCached(0)
</span><span class="cx">     , nonspacesCached(0)
</span><span class="cx">     , nonwordcharCached(0)
</span><ins>+    , nonwordUnicodeIgnoreCasecharCached(0)
</ins><span class="cx"> {
</span><span class="cx">     *error = compile(pattern);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreyarrYarrPatternh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/yarr/YarrPattern.h (199522 => 199523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/yarr/YarrPattern.h        2016-04-14 00:42:00 UTC (rev 199522)
+++ trunk/Source/JavaScriptCore/yarr/YarrPattern.h        2016-04-14 00:47:40 UTC (rev 199523)
</span><span class="lines">@@ -287,9 +287,11 @@
</span><span class="cx"> std::unique_ptr&lt;CharacterClass&gt; digitsCreate();
</span><span class="cx"> std::unique_ptr&lt;CharacterClass&gt; spacesCreate();
</span><span class="cx"> std::unique_ptr&lt;CharacterClass&gt; wordcharCreate();
</span><ins>+std::unique_ptr&lt;CharacterClass&gt; wordUnicodeIgnoreCaseCharCreate();
</ins><span class="cx"> std::unique_ptr&lt;CharacterClass&gt; nondigitsCreate();
</span><span class="cx"> std::unique_ptr&lt;CharacterClass&gt; nonspacesCreate();
</span><span class="cx"> std::unique_ptr&lt;CharacterClass&gt; nonwordcharCreate();
</span><ins>+std::unique_ptr&lt;CharacterClass&gt; nonwordUnicodeIgnoreCaseCharCreate();
</ins><span class="cx"> 
</span><span class="cx"> struct TermChain {
</span><span class="cx">     TermChain(PatternTerm term)
</span><span class="lines">@@ -317,9 +319,11 @@
</span><span class="cx">         digitsCached = 0;
</span><span class="cx">         spacesCached = 0;
</span><span class="cx">         wordcharCached = 0;
</span><ins>+        wordUnicodeIgnoreCaseCharCached = 0;
</ins><span class="cx">         nondigitsCached = 0;
</span><span class="cx">         nonspacesCached = 0;
</span><span class="cx">         nonwordcharCached = 0;
</span><ins>+        nonwordUnicodeIgnoreCasecharCached = 0;
</ins><span class="cx"> 
</span><span class="cx">         m_disjunctions.clear();
</span><span class="cx">         m_userCharacterClasses.clear();
</span><span class="lines">@@ -367,6 +371,14 @@
</span><span class="cx">         }
</span><span class="cx">         return wordcharCached;
</span><span class="cx">     }
</span><ins>+    CharacterClass* wordUnicodeIgnoreCaseCharCharacterClass()
+    {
+        if (!wordUnicodeIgnoreCaseCharCached) {
+            m_userCharacterClasses.append(wordUnicodeIgnoreCaseCharCreate());
+            wordUnicodeIgnoreCaseCharCached = m_userCharacterClasses.last().get();
+        }
+        return wordUnicodeIgnoreCaseCharCached;
+    }
</ins><span class="cx">     CharacterClass* nondigitsCharacterClass()
</span><span class="cx">     {
</span><span class="cx">         if (!nondigitsCached) {
</span><span class="lines">@@ -391,6 +403,14 @@
</span><span class="cx">         }
</span><span class="cx">         return nonwordcharCached;
</span><span class="cx">     }
</span><ins>+    CharacterClass* nonwordUnicodeIgnoreCaseCharCharacterClass()
+    {
+        if (!nonwordUnicodeIgnoreCasecharCached) {
+            m_userCharacterClasses.append(nonwordUnicodeIgnoreCaseCharCreate());
+            nonwordUnicodeIgnoreCasecharCached = m_userCharacterClasses.last().get();
+        }
+        return nonwordUnicodeIgnoreCasecharCached;
+    }
</ins><span class="cx"> 
</span><span class="cx">     bool ignoreCase() const { return m_flags &amp; FlagIgnoreCase; }
</span><span class="cx">     bool multiline() const { return m_flags &amp; FlagMultiline; }
</span><span class="lines">@@ -414,9 +434,11 @@
</span><span class="cx">     CharacterClass* digitsCached;
</span><span class="cx">     CharacterClass* spacesCached;
</span><span class="cx">     CharacterClass* wordcharCached;
</span><ins>+    CharacterClass* wordUnicodeIgnoreCaseCharCached;
</ins><span class="cx">     CharacterClass* nondigitsCached;
</span><span class="cx">     CharacterClass* nonspacesCached;
</span><span class="cx">     CharacterClass* nonwordcharCached;
</span><ins>+    CharacterClass* nonwordUnicodeIgnoreCasecharCached;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } } // namespace JSC::Yarr
</span></span></pre>
</div>
</div>

</body>
</html>