<!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>[195178] 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/195178">195178</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-01-16 16:04:37 -0800 (Sat, 16 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[ES6] Arrow function syntax. Arrow function should support the destructuring parameters.
https://bugs.webkit.org/show_bug.cgi?id=146934

Patch by Skachkov Oleksandr &lt;gskachkov@gmail.com&gt; on 2016-01-16
Reviewed by Saam Barati.
Source/JavaScriptCore:

Added support of destructuring parameters, before arrow function expect only simple parameters,
e.g. (), (x), (x, y) or x in assigment expressio. To support destructuring parameters added
additional check that check for destructuring paramters if check does not pass for simple parameters.

* parser/Parser.cpp:
(JSC::Parser&lt;LexerType&gt;::isArrowFunctionParameters):
(JSC::Parser&lt;LexerType&gt;::parseAssignmentExpression):
* parser/Parser.h:

LayoutTests:

* js/arrowfunction-syntax-errors-expected.txt:
* js/arrowfunction-syntax-expected.txt:
* js/script-tests/arrowfunction-syntax-errors.js:
* js/script-tests/arrowfunction-syntax.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsarrowfunctionsyntaxerrorsexpectedtxt">trunk/LayoutTests/js/arrowfunction-syntax-errors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsarrowfunctionsyntaxexpectedtxt">trunk/LayoutTests/js/arrowfunction-syntax-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsarrowfunctionsyntaxerrorsjs">trunk/LayoutTests/js/script-tests/arrowfunction-syntax-errors.js</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsarrowfunctionsyntaxjs">trunk/LayoutTests/js/script-tests/arrowfunction-syntax.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserParsercpp">trunk/Source/JavaScriptCore/parser/Parser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserParserh">trunk/Source/JavaScriptCore/parser/Parser.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195177 => 195178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-17 00:00:43 UTC (rev 195177)
+++ trunk/LayoutTests/ChangeLog        2016-01-17 00:04:37 UTC (rev 195178)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-01-16  Skachkov Oleksandr  &lt;gskachkov@gmail.com&gt;
+
+        [ES6] Arrow function syntax. Arrow function should support the destructuring parameters.
+        https://bugs.webkit.org/show_bug.cgi?id=146934
+
+        Reviewed by Saam Barati.
+
+        * js/arrowfunction-syntax-errors-expected.txt:
+        * js/arrowfunction-syntax-expected.txt:
+        * js/script-tests/arrowfunction-syntax-errors.js:
+        * js/script-tests/arrowfunction-syntax.js:
+
</ins><span class="cx"> 2016-01-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Add tests for Array Utilities like lowerBound/upperBound
</span></span></pre></div>
<a id="trunkLayoutTestsjsarrowfunctionsyntaxerrorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/arrowfunction-syntax-errors-expected.txt (195177 => 195178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/arrowfunction-syntax-errors-expected.txt        2016-01-17 00:00:43 UTC (rev 195177)
+++ trunk/LayoutTests/js/arrowfunction-syntax-errors-expected.txt        2016-01-17 00:04:37 UTC (rev 195178)
</span><span class="lines">@@ -123,6 +123,14 @@
</span><span class="cx"> =&gt;y+1 threw exception SyntaxError: Unexpected token '=&gt;'.
</span><span class="cx"> PASS var af3=(x, y)
</span><span class="cx"> =&gt;y+1 threw exception SyntaxError: Unexpected token '=&gt;'.
</span><ins>+PASS ([a, b] =&gt; a + b)([&quot;a_&quot;, &quot;b_&quot;]) threw exception SyntaxError: Unexpected token '=&gt;'. Expected ')' to end a compound expression..
+PASS ({a, b} =&gt; a + b)({a:&quot;a_&quot;, b:&quot;b_&quot;}) threw exception SyntaxError: Unexpected token '=&gt;'. Expected ')' to end a compound expression..
+PASS ({c:a,d:b} =&gt; a + b)({c:&quot;a_&quot;, d:&quot;b_&quot;}) threw exception SyntaxError: Unexpected token '=&gt;'. Expected ')' to end a compound expression..
+PASS ({c:b,d:a} =&gt; a + b)({c:&quot;a_&quot;, d:&quot;b_&quot;}) threw exception SyntaxError: Unexpected token '=&gt;'. Expected ')' to end a compound expression..
+PASS var arr1 = [a, b] =&gt; a + b; threw exception SyntaxError: Unexpected token '=&gt;'. Expected ';' after variable declaration..
+PASS var arr2 = {a, b} =&gt; a + b; threw exception SyntaxError: Unexpected token '=&gt;'. Expected ';' after variable declaration..
+PASS var arr3 = {c:a,d:b} =&gt; a + b; threw exception SyntaxError: Unexpected token '=&gt;'. Expected ';' after variable declaration..
+PASS var arr3 = {c:b,d:a} =&gt; a + b; threw exception SyntaxError: Unexpected token '=&gt;'. Expected ';' after variable declaration..
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsarrowfunctionsyntaxexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/arrowfunction-syntax-expected.txt (195177 => 195178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/arrowfunction-syntax-expected.txt        2016-01-17 00:00:43 UTC (rev 195177)
+++ trunk/LayoutTests/js/arrowfunction-syntax-expected.txt        2016-01-17 00:04:37 UTC (rev 195178)
</span><span class="lines">@@ -40,6 +40,22 @@
</span><span class="cx"> PASS (function funcSelfExecAE2(value) { var f = x =&gt; { x++; return x + 1; }; return f(value);})(123); is 125
</span><span class="cx"> PASS (function funcSelfExecAE3(value) { var f = (x) =&gt; { x++; return x + 1; }; return f(value);})(123); is 125
</span><span class="cx"> PASS (function funcSelfExecAE4(value) { var f = (x, y) =&gt; { x++; return x + y; }; return f(value, value * 2);})(123); is 370
</span><ins>+PASS (([a, b]) =&gt; a + b)([&quot;a_&quot;, &quot;b_&quot;]) is &quot;a_b_&quot;
+PASS (({a, b}) =&gt; a + b)({a:&quot;a_&quot;, b:&quot;b_&quot;}) is &quot;a_b_&quot;
+PASS (({c:a, d:b}) =&gt; a + b)({c:&quot;a_&quot;, d:&quot;b_&quot;}) is &quot;a_b_&quot;
+PASS (({c:b, d:a}) =&gt; a + b)({c:&quot;a_&quot;, d:&quot;b_&quot;}) is &quot;b_a_&quot;
+PASS ((x, y, {c:b, d:a}) =&gt; x + y + a + b)(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;}) is &quot;x_y_b_a_&quot;
+PASS (({c:b, d:a}, x, y) =&gt; x + y + a + b)({c:&quot;a_&quot;, d:&quot;b_&quot;}, &quot;x_&quot;, &quot;y_&quot;) is &quot;x_y_b_a_&quot;
+PASS ((x, y, {c:b, d:a}, [e, f]) =&gt; x + y + a + b + e + f)(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;}, [&quot;e_&quot;, &quot;f_&quot;]) is &quot;x_y_b_a_e_f_&quot;
+PASS ((x, y, {c:b, d:a}, [e, f], ...theArgs) =&gt; x + y + a + b + e + f + theArgs[0] + theArgs[1])(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;}, [&quot;e_&quot;, &quot;f_&quot;], &quot;g_&quot;, &quot;h_&quot;) is &quot;x_y_b_a_e_f_g_h_&quot;
+PASS arr1([&quot;a_&quot;, &quot;b_&quot;]) is &quot;a_b_&quot;
+PASS arr2({a:&quot;a_&quot;, b:&quot;b_&quot;}) is &quot;a_b_&quot;
+PASS arr3({c:&quot;a_&quot;, d:&quot;b_&quot;}) is &quot;a_b_&quot;
+PASS arr4({c:&quot;a_&quot;, d:&quot;b_&quot;}) is &quot;b_a_&quot;
+PASS arr5(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;}) is &quot;x_y_b_a_&quot;
+PASS arr6({c:&quot;a_&quot;, d:&quot;b_&quot;}, &quot;x_&quot;, &quot;y_&quot;) is &quot;x_y_b_a_&quot;
+PASS arr7(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;}, [&quot;e_&quot;, &quot;f_&quot;]) is &quot;x_y_b_a_e_f_&quot;
+PASS arr8(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;}, [&quot;e_&quot;, &quot;f_&quot;], &quot;g_&quot;, &quot;h_&quot;) is &quot;x_y_b_a_e_f_g_h_&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsarrowfunctionsyntaxerrorsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/arrowfunction-syntax-errors.js (195177 => 195178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/arrowfunction-syntax-errors.js        2016-01-17 00:00:43 UTC (rev 195177)
+++ trunk/LayoutTests/js/script-tests/arrowfunction-syntax-errors.js        2016-01-17 00:04:37 UTC (rev 195178)
</span><span class="lines">@@ -38,4 +38,14 @@
</span><span class="cx"> shouldThrow(&quot;var af2=(y)\n=&gt;y+1&quot;);
</span><span class="cx"> shouldThrow(&quot;var af3=(x, y)\n=&gt;y+1&quot;);
</span><span class="cx"> 
</span><ins>+shouldThrow('([a, b] =&gt; a + b)([&quot;a_&quot;, &quot;b_&quot;])' );
+shouldThrow('({a, b} =&gt; a + b)({a:&quot;a_&quot;, b:&quot;b_&quot;})');
+shouldThrow('({c:a,d:b} =&gt; a + b)({c:&quot;a_&quot;, d:&quot;b_&quot;})');
+shouldThrow('({c:b,d:a} =&gt; a + b)({c:&quot;a_&quot;, d:&quot;b_&quot;})');
+
+shouldThrow('var arr1 = [a, b] =&gt; a + b;');
+shouldThrow('var arr2 = {a, b} =&gt; a + b;');
+shouldThrow('var arr3 = {c:a,d:b} =&gt; a + b;');
+shouldThrow('var arr3 = {c:b,d:a} =&gt; a + b;');
+
</ins><span class="cx"> var successfullyParsed = true;
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsarrowfunctionsyntaxjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/arrowfunction-syntax.js (195177 => 195178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/arrowfunction-syntax.js        2016-01-17 00:00:43 UTC (rev 195177)
+++ trunk/LayoutTests/js/script-tests/arrowfunction-syntax.js        2016-01-17 00:04:37 UTC (rev 195178)
</span><span class="lines">@@ -79,4 +79,37 @@
</span><span class="cx"> 
</span><span class="cx"> shouldBe('(function funcSelfExecAE4(value) { var f = (x, y) =&gt; { x++; return x + y; }; return f(value, value * 2);})(123);', '370');
</span><span class="cx"> 
</span><ins>+shouldBe('(([a, b]) =&gt; a + b)([&quot;a_&quot;, &quot;b_&quot;])', '&quot;a_b_&quot;');
+shouldBe('(({a, b}) =&gt; a + b)({a:&quot;a_&quot;, b:&quot;b_&quot;})', '&quot;a_b_&quot;');
+shouldBe('(({c:a, d:b}) =&gt; a + b)({c:&quot;a_&quot;, d:&quot;b_&quot;})', '&quot;a_b_&quot;');
+shouldBe('(({c:b, d:a}) =&gt; a + b)({c:&quot;a_&quot;, d:&quot;b_&quot;})', '&quot;b_a_&quot;');
+shouldBe('((x, y, {c:b, d:a}) =&gt; x + y + a + b)(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;})', '&quot;x_y_b_a_&quot;');
+shouldBe('(({c:b, d:a}, x, y) =&gt; x + y + a + b)({c:&quot;a_&quot;, d:&quot;b_&quot;}, &quot;x_&quot;, &quot;y_&quot;)', '&quot;x_y_b_a_&quot;');
+shouldBe('((x, y, {c:b, d:a}, [e, f]) =&gt; x + y + a + b + e + f)(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;}, [&quot;e_&quot;, &quot;f_&quot;])', '&quot;x_y_b_a_e_f_&quot;');
+shouldBe('((x, y, {c:b, d:a}, [e, f], ...theArgs) =&gt; x + y + a + b + e + f + theArgs[0] + theArgs[1])(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;}, [&quot;e_&quot;, &quot;f_&quot;], &quot;g_&quot;, &quot;h_&quot;)', '&quot;x_y_b_a_e_f_g_h_&quot;');
+
+var arr1 = ([a, b]) =&gt; a + b;
+shouldBe('arr1([&quot;a_&quot;, &quot;b_&quot;])', '&quot;a_b_&quot;');
+
+var arr2 = ({a, b}) =&gt; a + b;
+shouldBe('arr2({a:&quot;a_&quot;, b:&quot;b_&quot;})', '&quot;a_b_&quot;');
+
+var arr3 = ({c:a, d:b}) =&gt; a + b;
+shouldBe('arr3({c:&quot;a_&quot;, d:&quot;b_&quot;})', '&quot;a_b_&quot;');
+
+var arr4 = ({c:b, d:a}) =&gt; a + b;
+shouldBe('arr4({c:&quot;a_&quot;, d:&quot;b_&quot;})', '&quot;b_a_&quot;');
+
+var arr5 = (x, y, {c:b, d:a}) =&gt; x + y + a + b;
+shouldBe('arr5(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;})', '&quot;x_y_b_a_&quot;');
+
+var arr6 = ({c:b, d:a}, x, y) =&gt; x + y + a + b;
+shouldBe('arr6({c:&quot;a_&quot;, d:&quot;b_&quot;}, &quot;x_&quot;, &quot;y_&quot;)', '&quot;x_y_b_a_&quot;');
+
+var arr7 = (x, y, {c:b, d:a}, [e, f]) =&gt; x + y + a + b + e + f;
+shouldBe('arr7(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;}, [&quot;e_&quot;, &quot;f_&quot;])', '&quot;x_y_b_a_e_f_&quot;');
+
+var arr8 = (x, y, {c:b, d:a}, [e, f], ...theArgs) =&gt; x + y + a + b + e + f + theArgs[0] + theArgs[1];
+shouldBe('arr8(&quot;x_&quot;, &quot;y_&quot;, {c:&quot;a_&quot;, d:&quot;b_&quot;}, [&quot;e_&quot;, &quot;f_&quot;], &quot;g_&quot;, &quot;h_&quot;)', '&quot;x_y_b_a_e_f_g_h_&quot;');
+
</ins><span class="cx"> var successfullyParsed = true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (195177 => 195178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-01-17 00:00:43 UTC (rev 195177)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-01-17 00:04:37 UTC (rev 195178)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-01-16  Skachkov Oleksandr  &lt;gskachkov@gmail.com&gt;
+
+        [ES6] Arrow function syntax. Arrow function should support the destructuring parameters.
+        https://bugs.webkit.org/show_bug.cgi?id=146934
+
+        Reviewed by Saam Barati.
+        
+        Added support of destructuring parameters, before arrow function expect only simple parameters,
+        e.g. (), (x), (x, y) or x in assigment expressio. To support destructuring parameters added
+        additional check that check for destructuring paramters if check does not pass for simple parameters.
+
+        * parser/Parser.cpp:
+        (JSC::Parser&lt;LexerType&gt;::isArrowFunctionParameters):
+        (JSC::Parser&lt;LexerType&gt;::parseAssignmentExpression):
+        * parser/Parser.h:
+
</ins><span class="cx"> 2016-01-15  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [JSC] Legalize Memory Offsets for ARM64 before lowering to Air
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Parser.cpp (195177 => 195178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Parser.cpp        2016-01-17 00:00:43 UTC (rev 195177)
+++ trunk/Source/JavaScriptCore/parser/Parser.cpp        2016-01-17 00:04:37 UTC (rev 195178)
</span><span class="lines">@@ -374,6 +374,49 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename LexerType&gt;
</span><ins>+bool Parser&lt;LexerType&gt;::isArrowFunctionParameters()
+{
+    bool isArrowFunction = false;
+
+    if (match(EOFTOK))
+        return false;
+    
+    bool isOpenParen = match(OPENPAREN);
+    bool isIdent = match(IDENT);
+    
+    if (!isOpenParen &amp;&amp; !isIdent)
+        return false;
+
+    SavePoint saveArrowFunctionPoint = createSavePoint();
+        
+    if (isIdent) {
+        next();
+        isArrowFunction = match(ARROWFUNCTION);
+    } else {
+        RELEASE_ASSERT(isOpenParen);
+        next();
+        if (match(CLOSEPAREN)) {
+            next();
+            isArrowFunction = match(ARROWFUNCTION);
+        } else {
+            SyntaxChecker syntaxChecker(const_cast&lt;VM*&gt;(m_vm), m_lexer.get());
+            // We make fake scope, otherwise parseFormalParameters will add variable to current scope that lead to errors
+            AutoPopScopeRef fakeScope(this, pushScope());
+            fakeScope-&gt;setSourceParseMode(SourceParseMode::ArrowFunctionMode);
+                
+            unsigned parametersCount = 0;
+            isArrowFunction = parseFormalParameters(syntaxChecker, syntaxChecker.createFormalParameterList(), parametersCount) &amp;&amp; consume(CLOSEPAREN) &amp;&amp; match(ARROWFUNCTION);
+                
+            popScope(fakeScope, syntaxChecker.NeedsFreeVariableInfo);
+        }
+    }
+        
+    restoreSavePoint(saveArrowFunctionPoint);
+        
+    return isArrowFunction;
+}
+
+template &lt;typename LexerType&gt;
</ins><span class="cx"> bool Parser&lt;LexerType&gt;::allowAutomaticSemicolon()
</span><span class="cx"> {
</span><span class="cx">     return match(CLOSEBRACE) || match(EOFTOK) || m_lexer-&gt;prevTerminator();
</span><span class="lines">@@ -2887,7 +2930,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
</span><del>-    if (isArrowFunctionParamters())
</del><ins>+    if (isArrowFunctionParameters())
</ins><span class="cx">         return parseArrowFunctionExpression(context);
</span><span class="cx"> #endif
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Parser.h (195177 => 195178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Parser.h        2016-01-17 00:00:43 UTC (rev 195177)
+++ trunk/Source/JavaScriptCore/parser/Parser.h        2016-01-17 00:04:37 UTC (rev 195178)
</span><span class="lines">@@ -1027,41 +1027,7 @@
</span><span class="cx">     {
</span><span class="cx">         return match(SEMICOLON) || match(COMMA) || match(CLOSEPAREN) || match(CLOSEBRACE) || match(CLOSEBRACKET) || match(EOFTOK) || m_lexer-&gt;prevTerminator();
</span><span class="cx">     }
</span><del>-    
-    ALWAYS_INLINE bool isArrowFunctionParamters()
-    {
-        bool isArrowFunction = false;
-        
-        if (match(EOFTOK))
-            return isArrowFunction;
-        
-        SavePoint saveArrowFunctionPoint = createSavePoint();
-        
-        if (consume(OPENPAREN)) {
-            bool isArrowFunctionParamters = true;
-            
-            while (consume(IDENT)) {
-                if (consume(COMMA)) {
-                    if (!match(IDENT)) {
-                        isArrowFunctionParamters = false;
-                        break;
-                    }
-                } else
-                    break;
-            }
-            
-            if (isArrowFunctionParamters) {
-                if (consume(CLOSEPAREN) &amp;&amp; match(ARROWFUNCTION))
-                    isArrowFunction = true;
-            }
-        } else if (consume(IDENT) &amp;&amp; match(ARROWFUNCTION))
-            isArrowFunction = true;
</del><span class="cx"> 
</span><del>-        restoreSavePoint(saveArrowFunctionPoint);
-        
-        return isArrowFunction;
-    }
-    
</del><span class="cx">     ALWAYS_INLINE unsigned tokenStart()
</span><span class="cx">     {
</span><span class="cx">         return m_token.m_location.startOffset;
</span><span class="lines">@@ -1258,6 +1224,8 @@
</span><span class="cx">     enum class FunctionDefinitionType { Expression, Declaration, Method };
</span><span class="cx">     template &lt;class TreeBuilder&gt; NEVER_INLINE bool parseFunctionInfo(TreeBuilder&amp;, FunctionRequirements, SourceParseMode, bool nameIsInContainingScope, ConstructorKind, SuperBinding, int functionKeywordStart, ParserFunctionInfo&lt;TreeBuilder&gt;&amp;, FunctionDefinitionType);
</span><span class="cx">     
</span><ins>+    ALWAYS_INLINE bool isArrowFunctionParameters();
+    
</ins><span class="cx">     template &lt;class TreeBuilder&gt; NEVER_INLINE int parseFunctionParameters(TreeBuilder&amp;, SourceParseMode, ParserFunctionInfo&lt;TreeBuilder&gt;&amp;);
</span><span class="cx">     template &lt;class TreeBuilder&gt; NEVER_INLINE typename TreeBuilder::FormalParameterList createGeneratorParameters(TreeBuilder&amp;);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>