<!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>[197962] 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/197962">197962</a></dd>
<dt>Author</dt> <dd>msaboff@apple.com</dd>
<dt>Date</dt> <dd>2016-03-10 15:38:15 -0800 (Thu, 10 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[ES6] Allow RegExp constructor to take pattern from an existing RegExp with new flags
https://bugs.webkit.org/show_bug.cgi?id=155315

Reviewed by Saam Barati.

Source/JavaScriptCore:

Changed to comply with section 21.2.3.1, step 5.  Eliminated syntax error.

In the process, change to get the VM at the top of the function.

Updated tests accordingly.

* runtime/RegExpConstructor.cpp:
(JSC::constructRegExp):
* tests/es6.yaml: Changed miscellaneous_RegExp_constructor_can_alter_flags.js to normal.
* tests/mozilla/mozilla-tests.yaml: Disabled ecma_3/RegExp/15.10.4.1-5-n.js as it checks
for the old behavior of throwing a syntax error.

LayoutTests:

New and updated test for change.

* fast/regex/constructor-expected.txt:
* fast/regex/script-tests/constructor.js:
Changed test for new behavior.`

* js/regexp-old-regexp-new-flags-expected.txt: Added.
* js/regexp-old-regexp-new-flags.html: Added.
* js/script-tests/regexp-old-regexp-new-flags.js: Added.
New test.

* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1-expected.txt: Removed.
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1.html: Removed.
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2-expected.txt: Removed.
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2.html: Removed.
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1-expected.txt: Removed.
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1.html: Removed.
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2-expected.txt: Removed.
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2.html: Removed.
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8-expected.txt: Removed.
* sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8.html: Removed.
Removed obsolete tests.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastregexconstructorexpectedtxt">trunk/LayoutTests/fast/regex/constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastregexscripttestsconstructorjs">trunk/LayoutTests/fast/regex/script-tests/constructor.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeRegExpConstructorcpp">trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoretestses6yaml">trunk/Source/JavaScriptCore/tests/es6.yaml</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsmozillamozillatestsyaml">trunk/Source/JavaScriptCore/tests/mozilla/mozilla-tests.yaml</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsregexpoldregexpnewflagsexpectedtxt">trunk/LayoutTests/js/regexp-old-regexp-new-flags-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsregexpoldregexpnewflagshtml">trunk/LayoutTests/js/regexp-old-regexp-new-flags.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsregexpoldregexpnewflagsjs">trunk/LayoutTests/js/script-tests/regexp-old-regexp-new-flags.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15103S151031_A2_T1expectedtxt">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1-expected.txt</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15103S151031_A2_T1html">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1.html</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15103S151031_A2_T2expectedtxt">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2-expected.txt</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15103S151031_A2_T2html">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2.html</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A2_T1expectedtxt">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1-expected.txt</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A2_T1html">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1.html</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A2_T2expectedtxt">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2-expected.txt</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A2_T2html">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2.html</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A8_T8expectedtxt">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8-expected.txt</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A8_T8html">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/ChangeLog        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2016-03-10  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        [ES6] Allow RegExp constructor to take pattern from an existing RegExp with new flags
+        https://bugs.webkit.org/show_bug.cgi?id=155315
+
+        Reviewed by Saam Barati.
+
+        New and updated test for change.
+
+        * fast/regex/constructor-expected.txt:
+        * fast/regex/script-tests/constructor.js:
+        Changed test for new behavior.`
+
+        * js/regexp-old-regexp-new-flags-expected.txt: Added.
+        * js/regexp-old-regexp-new-flags.html: Added.
+        * js/script-tests/regexp-old-regexp-new-flags.js: Added.
+        New test.
+
+        * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1-expected.txt: Removed.
+        * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1.html: Removed.
+        * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2-expected.txt: Removed.
+        * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2.html: Removed.
+        * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1-expected.txt: Removed.
+        * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1.html: Removed.
+        * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2-expected.txt: Removed.
+        * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2.html: Removed.
+        * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8-expected.txt: Removed.
+        * sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8.html: Removed.
+        Removed obsolete tests.
+
</ins><span class="cx"> 2016-03-10  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [OS X] Main frame scrollbars should appear on the left on RTL systems
</span></span></pre></div>
<a id="trunkLayoutTestsfastregexconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/regex/constructor-expected.txt (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regex/constructor-expected.txt        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/fast/regex/constructor-expected.txt        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -5,8 +5,8 @@
</span><span class="cx"> 
</span><span class="cx"> PASS re === RegExp(re) is true
</span><span class="cx"> PASS re !== new RegExp(re) is true
</span><del>-PASS re === RegExp(re,'i') threw exception TypeError: Cannot supply flags when constructing one RegExp from another..
-PASS re !== new RegExp(re,'i') threw exception TypeError: Cannot supply flags when constructing one RegExp from another..
</del><ins>+PASS re === RegExp(re,'i') is true
+PASS re !== new RegExp(re,'i') is true
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastregexscripttestsconstructorjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/regex/script-tests/constructor.js (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regex/script-tests/constructor.js        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/fast/regex/script-tests/constructor.js        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -4,6 +4,6 @@
</span><span class="cx"> 
</span><span class="cx"> shouldBeTrue(&quot;re === RegExp(re)&quot;);
</span><span class="cx"> shouldBeTrue(&quot;re !== new RegExp(re)&quot;);
</span><del>-shouldThrow(&quot;re === RegExp(re,'i')&quot;);
-shouldThrow(&quot;re !== new RegExp(re,'i')&quot;);
</del><ins>+shouldBeTrue(&quot;re === RegExp(re,'i')&quot;);
+shouldBeTrue(&quot;re !== new RegExp(re,'i')&quot;);
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsjsregexpoldregexpnewflagsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regexp-old-regexp-new-flags-expected.txt (0 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regexp-old-regexp-new-flags-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/regexp-old-regexp-new-flags-expected.txt        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+Test for ES6 RegExp construct a new RegExp from exiting RegExp pattern and new flags
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS re.test(&quot;   Abc   &quot;) is true
+PASS re.flags is &quot;&quot;
+PASS re.test(&quot; ABC  &quot;) is true
+PASS re.flags is &quot;i&quot;
+PASS re.test(&quot;   Abc   &quot;) is true
+PASS re.flags is &quot;&quot;
+PASS re.exec(&quot;abcABCAbc&quot;).toString() is &quot;abc&quot;
+PASS re.exec(&quot;abcABCAbc&quot;).toString() is &quot;ABC&quot;
+PASS re.exec(&quot;abcABCAbc&quot;).toString() is &quot;Abc&quot;
+PASS re.flags is &quot;iy&quot;
+PASS re.test(&quot;abc&quot;) is false
+PASS new RegExp(re, &quot;bad flags&quot;) threw exception SyntaxError: Invalid flags supplied to RegExp constructor..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregexpoldregexpnewflagshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regexp-old-regexp-new-flags.html (0 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regexp-old-regexp-new-flags.html                                (rev 0)
+++ trunk/LayoutTests/js/regexp-old-regexp-new-flags.html        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/regexp-old-regexp-new-flags.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsregexpoldregexpnewflagsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/regexp-old-regexp-new-flags.js (0 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/regexp-old-regexp-new-flags.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/regexp-old-regexp-new-flags.js        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+description(
+'Test for ES6 RegExp construct a new RegExp from exiting RegExp pattern and new flags'
+);
+
+var re = new RegExp(&quot;Abc&quot;);
+shouldBeTrue('re.test(&quot;   Abc   &quot;)');
+shouldBe('re.flags', '&quot;&quot;');
+
+re = new RegExp(re, &quot;i&quot;);
+shouldBeTrue('re.test(&quot; ABC  &quot;)');
+shouldBe('re.flags', '&quot;i&quot;');
+
+re = new RegExp(re, &quot;&quot;);
+shouldBeTrue('re.test(&quot;   Abc   &quot;)');
+shouldBe('re.flags', '&quot;&quot;');
+
+re = new RegExp(re, &quot;iy&quot;);
+shouldBe('re.exec(&quot;abcABCAbc&quot;).toString()', '&quot;abc&quot;');
+shouldBe('re.exec(&quot;abcABCAbc&quot;).toString()', '&quot;ABC&quot;');
+shouldBe('re.exec(&quot;abcABCAbc&quot;).toString()', '&quot;Abc&quot;');
+shouldBe('re.flags', '&quot;iy&quot;');
+
+re = new RegExp(re, &quot;&quot;);
+shouldBeFalse('re.test(&quot;abc&quot;)');
+
+shouldThrow('new RegExp(re, &quot;bad flags&quot;)', '&quot;SyntaxError: Invalid flags supplied to RegExp constructor.&quot;');
</ins></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15103S151031_A2_T1expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1-expected.txt (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1-expected.txt        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1-expected.txt        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-S15.10.3.1_A2_T1
-
-PASS 
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15103S151031_A2_T1html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1.html (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1.html        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T1.html        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,103 +0,0 @@
</span><del>-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset='utf-8'&gt;
-&lt;style&gt;
-.pass {
-    font-weight: bold;
-    color: green;
-}
-.fail {
-    font-weight: bold;
-    color: red;
-}
-&lt;/style&gt;
-
-&lt;script&gt;
-if (window.testRunner)
-    testRunner.dumpAsText();
-
-function SputnikError(message)
-{
-    this.message = message;
-}
-
-SputnikError.prototype.toString = function ()
-{
-    return 'SputnikError: ' + this.message;
-};
-
-var sputnikException;
-
-function testPrint(msg)
-{
-    var span = document.createElement(&quot;span&quot;);
-    document.getElementById(&quot;console&quot;).appendChild(span); // insert it first so XHTML knows the namespace 
-    span.innerHTML = msg + '&lt;br /&gt;';
-}
-
-function escapeHTML(text)
-{
-    return text.toString().replace(/&amp;/g, &quot;&amp;amp;&quot;).replace(/&lt;/g, &quot;&amp;lt;&quot;);
-}
-
-function printTestPassed(msg)
-{
-    testPrint('&lt;span&gt;&lt;span class=&quot;pass&quot;&gt;PASS&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
-}
-
-function printTestFailed(msg)
-{
-    testPrint('&lt;span&gt;&lt;span class=&quot;fail&quot;&gt;FAIL&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
-}
-
-function testFailed(msg)
-{
-    throw new SputnikError(msg);
-}
-
-var successfullyParsed = false;
-&lt;/script&gt;
-
-&lt;/head&gt;
-&lt;body&gt;
-&lt;p&gt;S15.10.3.1_A2_T1&lt;/p&gt;
-&lt;div id='console'&gt;&lt;/div&gt;
-&lt;script&gt;
-try {
-
-/**
-* @name: S15.10.3.1_A2_T1;
-* @section: 15.10.3.1;
-* @assertion: If pattern is an object R whose [[Class]] property is &quot;RegExp&quot; and flags is defined, then 
-* call the RegExp constructor (15.10.4.1), passing it the pattern and flags arguments and return the object constructed by that constructor;
-* @description: Checking if using &quot;1&quot; as flags leads to throwing the correct exception;
-*/
-
-//CHECK#1
-try {
-        testFailed('#1.1: RegExp(new RegExp(&quot;\\d&quot;), &quot;1&quot;)) throw TypeError. Actual: ' + (RegExp(new RegExp(&quot;\d&quot;), &quot;1&quot;)));
-} catch (e) {
-        if ((e instanceof TypeError) !== true) {
-                testFailed('#1.2: RegExp(new RegExp(&quot;\\d&quot;), &quot;1&quot;)) throw TypeError. Actual: ' + (e));
-        }
-}
-
-
-} catch (ex) {
-    sputnikException = ex;
-}
-
-var successfullyParsed = true;
-&lt;/script&gt;
-
-&lt;script&gt;
-if (!successfullyParsed)
-    printTestFailed('successfullyParsed is not set');
-else if (sputnikException)
-    printTestFailed(sputnikException);
-else
-    printTestPassed(&quot;&quot;);
-testPrint('&lt;br /&gt;&lt;span class=&quot;pass&quot;&gt;TEST COMPLETE&lt;/span&gt;');
-&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15103S151031_A2_T2expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2-expected.txt (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2-expected.txt        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2-expected.txt        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-S15.10.3.1_A2_T2
-
-PASS 
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15103S151031_A2_T2html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2.html (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2.html        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.3/S15.10.3.1_A2_T2.html        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,105 +0,0 @@
</span><del>-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset='utf-8'&gt;
-&lt;style&gt;
-.pass {
-    font-weight: bold;
-    color: green;
-}
-.fail {
-    font-weight: bold;
-    color: red;
-}
-&lt;/style&gt;
-
-&lt;script&gt;
-if (window.testRunner)
-    testRunner.dumpAsText();
-
-function SputnikError(message)
-{
-    this.message = message;
-}
-
-SputnikError.prototype.toString = function ()
-{
-    return 'SputnikError: ' + this.message;
-};
-
-var sputnikException;
-
-function testPrint(msg)
-{
-    var span = document.createElement(&quot;span&quot;);
-    document.getElementById(&quot;console&quot;).appendChild(span); // insert it first so XHTML knows the namespace 
-    span.innerHTML = msg + '&lt;br /&gt;';
-}
-
-function escapeHTML(text)
-{
-    return text.toString().replace(/&amp;/g, &quot;&amp;amp;&quot;).replace(/&lt;/g, &quot;&amp;lt;&quot;);
-}
-
-function printTestPassed(msg)
-{
-    testPrint('&lt;span&gt;&lt;span class=&quot;pass&quot;&gt;PASS&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
-}
-
-function printTestFailed(msg)
-{
-    testPrint('&lt;span&gt;&lt;span class=&quot;fail&quot;&gt;FAIL&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
-}
-
-function testFailed(msg)
-{
-    throw new SputnikError(msg);
-}
-
-var successfullyParsed = false;
-&lt;/script&gt;
-
-&lt;/head&gt;
-&lt;body&gt;
-&lt;p&gt;S15.10.3.1_A2_T2&lt;/p&gt;
-&lt;div id='console'&gt;&lt;/div&gt;
-&lt;script&gt;
-try {
-
-/**
-* @name: S15.10.3.1_A2_T2;
-* @section: 15.10.3.1;
-* @assertion: If pattern is an object R whose [[Class]] property is &quot;RegExp&quot; and flags is defined, then 
-* call the RegExp constructor (15.10.4.1), passing it the pattern and flags arguments and return the object constructed by that constructor;
-* @description: Checking if using dafined variable &quot;x = 1&quot; as flags leads to throwing the correct exception;
-*/
-
-var x = 1;
-
-//CHECK#1
-try {
-        testFailed('#1.1: var x = 1; RegExp(/[a-b]?/, x) throw TypeError. Actual: ' + (RegExp(/[a-b]?/, x)));
-} catch (e) {
-        if ((e instanceof TypeError) !== true) {
-                testFailed('#1.2: var x = 1; RegExp(/[a-b]?/, x) throw TypeError. Actual: ' + (e));
-        } 
-}
-
-
-} catch (ex) {
-    sputnikException = ex;
-}
-
-var successfullyParsed = true;
-&lt;/script&gt;
-
-&lt;script&gt;
-if (!successfullyParsed)
-    printTestFailed('successfullyParsed is not set');
-else if (sputnikException)
-    printTestFailed(sputnikException);
-else
-    printTestPassed(&quot;&quot;);
-testPrint('&lt;br /&gt;&lt;span class=&quot;pass&quot;&gt;TEST COMPLETE&lt;/span&gt;');
-&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A2_T1expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1-expected.txt (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1-expected.txt        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1-expected.txt        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-S15.10.4.1_A2_T1
-
-PASS 
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A2_T1html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1.html (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1.html        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T1.html        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,102 +0,0 @@
</span><del>-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset='utf-8'&gt;
-&lt;style&gt;
-.pass {
-    font-weight: bold;
-    color: green;
-}
-.fail {
-    font-weight: bold;
-    color: red;
-}
-&lt;/style&gt;
-
-&lt;script&gt;
-if (window.testRunner)
-    testRunner.dumpAsText();
-
-function SputnikError(message)
-{
-    this.message = message;
-}
-
-SputnikError.prototype.toString = function ()
-{
-    return 'SputnikError: ' + this.message;
-};
-
-var sputnikException;
-
-function testPrint(msg)
-{
-    var span = document.createElement(&quot;span&quot;);
-    document.getElementById(&quot;console&quot;).appendChild(span); // insert it first so XHTML knows the namespace 
-    span.innerHTML = msg + '&lt;br /&gt;';
-}
-
-function escapeHTML(text)
-{
-    return text.toString().replace(/&amp;/g, &quot;&amp;amp;&quot;).replace(/&lt;/g, &quot;&amp;lt;&quot;);
-}
-
-function printTestPassed(msg)
-{
-    testPrint('&lt;span&gt;&lt;span class=&quot;pass&quot;&gt;PASS&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
-}
-
-function printTestFailed(msg)
-{
-    testPrint('&lt;span&gt;&lt;span class=&quot;fail&quot;&gt;FAIL&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
-}
-
-function testFailed(msg)
-{
-    throw new SputnikError(msg);
-}
-
-var successfullyParsed = false;
-&lt;/script&gt;
-
-&lt;/head&gt;
-&lt;body&gt;
-&lt;p&gt;S15.10.4.1_A2_T1&lt;/p&gt;
-&lt;div id='console'&gt;&lt;/div&gt;
-&lt;script&gt;
-try {
-
-/**
-* @name: S15.10.4.1_A2_T1;
-* @section: 15.10.4.1;
-* @assertion: If pattern is an object R whose [[Class]] property is &quot;RegExp&quot; and flags is not undefined, then throw a TypeError exception;
-* @description: Checking if execution of &quot;new RegExp(pattern, &quot;i&quot;)&quot;, where the pattern is &quot;/\u0042/i&quot;, fails;
-*/
-
-//CHECK#1
-try {
-        testFailed('#1.1: new RegExp(/\\u0042/i, &quot;i&quot;) throw TypeError. Actual: ' + (new RegExp(/\u0042/i, &quot;i&quot;))); 
-} catch (e) {
-        if ((e instanceof TypeError) !== true) {
-                testFailed('#1.2: new RegExp(/\\u0042/i, &quot;i&quot;) throw TypeError. Actual: ' + (e));
-        }
-}
-
-
-} catch (ex) {
-    sputnikException = ex;
-}
-
-var successfullyParsed = true;
-&lt;/script&gt;
-
-&lt;script&gt;
-if (!successfullyParsed)
-    printTestFailed('successfullyParsed is not set');
-else if (sputnikException)
-    printTestFailed(sputnikException);
-else
-    printTestPassed(&quot;&quot;);
-testPrint('&lt;br /&gt;&lt;span class=&quot;pass&quot;&gt;TEST COMPLETE&lt;/span&gt;');
-&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A2_T2expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2-expected.txt (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2-expected.txt        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2-expected.txt        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-S15.10.4.1_A2_T2
-
-PASS 
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A2_T2html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2.html (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2.html        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A2_T2.html        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,102 +0,0 @@
</span><del>-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset='utf-8'&gt;
-&lt;style&gt;
-.pass {
-    font-weight: bold;
-    color: green;
-}
-.fail {
-    font-weight: bold;
-    color: red;
-}
-&lt;/style&gt;
-
-&lt;script&gt;
-if (window.testRunner)
-    testRunner.dumpAsText();
-
-function SputnikError(message)
-{
-    this.message = message;
-}
-
-SputnikError.prototype.toString = function ()
-{
-    return 'SputnikError: ' + this.message;
-};
-
-var sputnikException;
-
-function testPrint(msg)
-{
-    var span = document.createElement(&quot;span&quot;);
-    document.getElementById(&quot;console&quot;).appendChild(span); // insert it first so XHTML knows the namespace 
-    span.innerHTML = msg + '&lt;br /&gt;';
-}
-
-function escapeHTML(text)
-{
-    return text.toString().replace(/&amp;/g, &quot;&amp;amp;&quot;).replace(/&lt;/g, &quot;&amp;lt;&quot;);
-}
-
-function printTestPassed(msg)
-{
-    testPrint('&lt;span&gt;&lt;span class=&quot;pass&quot;&gt;PASS&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
-}
-
-function printTestFailed(msg)
-{
-    testPrint('&lt;span&gt;&lt;span class=&quot;fail&quot;&gt;FAIL&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
-}
-
-function testFailed(msg)
-{
-    throw new SputnikError(msg);
-}
-
-var successfullyParsed = false;
-&lt;/script&gt;
-
-&lt;/head&gt;
-&lt;body&gt;
-&lt;p&gt;S15.10.4.1_A2_T2&lt;/p&gt;
-&lt;div id='console'&gt;&lt;/div&gt;
-&lt;script&gt;
-try {
-
-/**
-* @name: S15.10.4.1_A2_T2;
-* @section: 15.10.4.1;
-* @assertion: If pattern is an object R whose [[Class]] property is &quot;RegExp&quot; and flags is not undefined, then throw a TypeError exception;
-* @description: Checking if execution of &quot;new RegExp(pattern, {})&quot;, where the pattern is &quot;/1?1/mig&quot;, fails;
-*/
-
-//CHECK#1
-try {
-  testFailed('#1.1: new RegExp(/1?1/mig, {}) throw TypeError. Actual: ' + (new RegExp(/1?1/mig, {}))); 
-} catch (e) {
-  if ((e instanceof TypeError) !== true) {
-    testFailed('#1.2: new RegExp(/1?1/mig, {}) throw TypeError. Actual: ' + (e));
-  }
-}
-
-
-} catch (ex) {
-    sputnikException = ex;
-}
-
-var successfullyParsed = true;
-&lt;/script&gt;
-
-&lt;script&gt;
-if (!successfullyParsed)
-    printTestFailed('successfullyParsed is not set');
-else if (sputnikException)
-    printTestFailed(sputnikException);
-else
-    printTestPassed(&quot;&quot;);
-testPrint('&lt;br /&gt;&lt;span class=&quot;pass&quot;&gt;TEST COMPLETE&lt;/span&gt;');
-&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A8_T8expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8-expected.txt (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8-expected.txt        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8-expected.txt        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-S15.10.4.1_A8_T8
-
-PASS 
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects1510_RegExp15104S151041_A8_T8html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8.html (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8.html        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.4/S15.10.4.1_A8_T8.html        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,102 +0,0 @@
</span><del>-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset='utf-8'&gt;
-&lt;style&gt;
-.pass {
-    font-weight: bold;
-    color: green;
-}
-.fail {
-    font-weight: bold;
-    color: red;
-}
-&lt;/style&gt;
-
-&lt;script&gt;
-if (window.testRunner)
-    testRunner.dumpAsText();
-
-function SputnikError(message)
-{
-    this.message = message;
-}
-
-SputnikError.prototype.toString = function ()
-{
-    return 'SputnikError: ' + this.message;
-};
-
-var sputnikException;
-
-function testPrint(msg)
-{
-    var span = document.createElement(&quot;span&quot;);
-    document.getElementById(&quot;console&quot;).appendChild(span); // insert it first so XHTML knows the namespace 
-    span.innerHTML = msg + '&lt;br /&gt;';
-}
-
-function escapeHTML(text)
-{
-    return text.toString().replace(/&amp;/g, &quot;&amp;amp;&quot;).replace(/&lt;/g, &quot;&amp;lt;&quot;);
-}
-
-function printTestPassed(msg)
-{
-    testPrint('&lt;span&gt;&lt;span class=&quot;pass&quot;&gt;PASS&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
-}
-
-function printTestFailed(msg)
-{
-    testPrint('&lt;span&gt;&lt;span class=&quot;fail&quot;&gt;FAIL&lt;/span&gt; ' + escapeHTML(msg) + '&lt;/span&gt;');
-}
-
-function testFailed(msg)
-{
-    throw new SputnikError(msg);
-}
-
-var successfullyParsed = false;
-&lt;/script&gt;
-
-&lt;/head&gt;
-&lt;body&gt;
-&lt;p&gt;S15.10.4.1_A8_T8&lt;/p&gt;
-&lt;div id='console'&gt;&lt;/div&gt;
-&lt;script&gt;
-try {
-
-/**
-* @name: S15.10.4.1_A8_T8;
-* @section: 15.10.4.1;
-* @assertion: let P be ToString(pattern) and let F be ToString(flags);
-* @description: Pattern is {toString:function(){throw &quot;intostr&quot;;} } and flags is &quot;error&quot;;
-*/
-
-//CHECK#1
-try {
-        testFailed('#1.1: new RegExp({toString:function(){throw &quot;intostr&quot;;}}, &quot;error&quot;) throw &quot;intostr&quot;. Actual: ' + (new RegExp({toString:function(){throw &quot;intostr&quot;;}}, &quot;error&quot;)));
-} catch (e) {
-        if (e !== &quot;intostr&quot; ) {
-                testFailed('#1.2: new RegExp({toString:function(){throw &quot;intostr&quot;;}}, &quot;error&quot;) throw &quot;intostr&quot;. Actual: ' + (e));
-        }
-}
-
-
-} catch (ex) {
-    sputnikException = ex;
-}
-
-var successfullyParsed = true;
-&lt;/script&gt;
-
-&lt;script&gt;
-if (!successfullyParsed)
-    printTestFailed('successfullyParsed is not set');
-else if (sputnikException)
-    printTestFailed(sputnikException);
-else
-    printTestPassed(&quot;&quot;);
-testPrint('&lt;br /&gt;&lt;span class=&quot;pass&quot;&gt;TEST COMPLETE&lt;/span&gt;');
-&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-03-10  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        [ES6] Allow RegExp constructor to take pattern from an existing RegExp with new flags
+        https://bugs.webkit.org/show_bug.cgi?id=155315
+
+        Reviewed by Saam Barati.
+
+        Changed to comply with section 21.2.3.1, step 5.  Eliminated syntax error.
+
+        In the process, change to get the VM at the top of the function.
+
+        Updated tests accordingly.
+
+        * runtime/RegExpConstructor.cpp:
+        (JSC::constructRegExp):
+        * tests/es6.yaml: Changed miscellaneous_RegExp_constructor_can_alter_flags.js to normal.
+        * tests/mozilla/mozilla-tests.yaml: Disabled ecma_3/RegExp/15.10.4.1-5-n.js as it checks
+        for the old behavior of throwing a syntax error.
+
</ins><span class="cx"> 2016-03-10  Saam barati  &lt;sbarati@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ES6] Make ToPropertyDescriptor spec compliant
</span><span class="lines">@@ -82,6 +101,7 @@
</span><span class="cx">         (noAssign): Deleted.
</span><span class="cx">         (catch): Deleted.
</span><span class="cx"> 
</span><ins>+&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r197960
</ins><span class="cx"> 2016-03-08  Skachkov Oleksandr  &lt;gskachkov@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         How we load new.target in arrow functions is broken
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -260,41 +260,47 @@
</span><span class="cx">     JSValue arg0 = args.at(0);
</span><span class="cx">     JSValue arg1 = args.at(1);
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    RegExpFlags flags = NoFlags;
+    bool haveFlags = false;
+    if (!arg1.isUndefined()) {
+        flags = regExpFlags(arg1.toString(exec)-&gt;value(exec));
+        if (vm.exception())
+            return 0;
+        if (flags == InvalidFlags)
+            return vm.throwException(exec, createSyntaxError(exec, ASCIILiteral(&quot;Invalid flags supplied to RegExp constructor.&quot;)));
+        haveFlags = true;
+    }
+
</ins><span class="cx">     if (arg0.inherits(RegExpObject::info())) {
</span><del>-        if (!arg1.isUndefined())
-            return exec-&gt;vm().throwException(exec, createTypeError(exec, ASCIILiteral(&quot;Cannot supply flags when constructing one RegExp from another.&quot;)));
</del><span class="cx">         // If called as a function, this just returns the first argument (see 15.10.3.1).
</span><span class="cx">         if (newTarget != jsUndefined()) {
</span><span class="cx">             RegExp* regExp = static_cast&lt;RegExpObject*&gt;(asObject(arg0))-&gt;regExp();
</span><span class="cx">             Structure* structure = getRegExpStructure(exec, globalObject, newTarget);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (vm.exception())
</ins><span class="cx">                 return nullptr;
</span><span class="cx"> 
</span><del>-            return RegExpObject::create(exec-&gt;vm(), structure, regExp);
</del><ins>+            if (haveFlags) {
+                regExp = RegExp::create(vm, regExp-&gt;pattern(), flags);
+                if (vm.exception())
+                    return nullptr;
+            }
+
+            return RegExpObject::create(vm, structure, regExp);
</ins><span class="cx">         }
</span><span class="cx">         return asObject(arg0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String pattern = arg0.isUndefined() ? emptyString() : arg0.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (vm.exception())
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    RegExpFlags flags = NoFlags;
-    if (!arg1.isUndefined()) {
-        flags = regExpFlags(arg1.toString(exec)-&gt;value(exec));
-        if (exec-&gt;hadException())
-            return 0;
-        if (flags == InvalidFlags)
-            return exec-&gt;vm().throwException(exec, createSyntaxError(exec, ASCIILiteral(&quot;Invalid flags supplied to RegExp constructor.&quot;)));
-    }
-
-    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     RegExp* regExp = RegExp::create(vm, pattern, flags);
</span><span class="cx">     if (!regExp-&gt;isValid())
</span><span class="cx">         return vm.throwException(exec, createSyntaxError(exec, regExp-&gt;errorMessage()));
</span><span class="cx"> 
</span><span class="cx">     Structure* structure = getRegExpStructure(exec, globalObject, newTarget);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (vm.exception())
</ins><span class="cx">         return nullptr;
</span><span class="cx">     return RegExpObject::create(vm, structure, regExp);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestses6yaml"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/es6.yaml (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/es6.yaml        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/Source/JavaScriptCore/tests/es6.yaml        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -873,7 +873,7 @@
</span><span class="cx"> - path: es6/miscellaneous_no_assignments_allowed_in_for-in_head.js
</span><span class="cx">   cmd: runES6 :fail
</span><span class="cx"> - path: es6/miscellaneous_RegExp_constructor_can_alter_flags.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/new.target_assignment_is_an_early_error.js
</span><span class="cx">   cmd: runES6 :normal
</span><span class="cx"> - path: es6/non-strict_function_semantics_hoisted_block-level_function_declaration.js
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsmozillamozillatestsyaml"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/mozilla/mozilla-tests.yaml (197961 => 197962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/mozilla/mozilla-tests.yaml        2016-03-10 23:18:55 UTC (rev 197961)
+++ trunk/Source/JavaScriptCore/tests/mozilla/mozilla-tests.yaml        2016-03-10 23:38:15 UTC (rev 197962)
</span><span class="lines">@@ -1662,8 +1662,9 @@
</span><span class="cx">   cmd: defaultRunMozillaTest :normal, &quot;../shell.js&quot;, &quot;shell.js&quot;
</span><span class="cx"> - path: ecma_3/RegExp/15.10.4.1-4.js
</span><span class="cx">   cmd: defaultRunMozillaTest :normal, &quot;../shell.js&quot;, &quot;shell.js&quot;
</span><del>-- path: ecma_3/RegExp/15.10.4.1-5-n.js
-  cmd: defaultRunMozillaTest :negative, &quot;../shell.js&quot;, &quot;shell.js&quot;
</del><ins>+# Test is no longer valid with ES6 changes
+# - path: ecma_3/RegExp/15.10.4.1-5-n.js
+#   cmd: defaultRunMozillaTest :negative, &quot;../shell.js&quot;, &quot;shell.js&quot;
</ins><span class="cx"> - path: ecma_3/RegExp/15.10.6.2-1.js
</span><span class="cx">   cmd: defaultRunMozillaTest :normal, &quot;../shell.js&quot;, &quot;shell.js&quot;
</span><span class="cx"> - path: ecma_3/RegExp/15.10.6.2-2.js
</span></span></pre>
</div>
</div>

</body>
</html>