<!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>[197867] 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/197867">197867</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2016-03-09 11:36:21 -0800 (Wed, 09 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>FunctionExecutable::ecmaName() should not be based on inferredName().
https://bugs.webkit.org/show_bug.cgi?id=155203

Reviewed by Michael Saboff.

Source/JavaScriptCore:

The ES6 rules for how a function name should be inferred closely matches JSC's
implementation with one exception:
    var o = {}
    o.foo = function() {}

JSC's inferredName for o.foo would be &quot;foo&quot;.
ES6 specifies that o.foo.name is &quot;&quot;.

The fix is to add a distinct FunctionExecutable::ecmaName() which applies the ES6
rules for inferring the initial value of Function.name.

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedFunctionExecutable.h:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createAssignResolve):
(JSC::ASTBuilder::createGetterOrSetterProperty):
(JSC::ASTBuilder::createProperty):
(JSC::ASTBuilder::makeAssignNode):
* parser/Nodes.h:
* runtime/Executable.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::reifyName):
* tests/es6.yaml:

LayoutTests:

* js/script-tests/function-toString-vs-name.js:
- Fixed up object property test section and added new test cases.
* platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsfunctiontoStringvsnamejs">trunk/LayoutTests/js/script-tests/function-toString-vs-name.js</a></li>
<li><a href="#trunkLayoutTestsplatformmachttptestsmediamediasourcemediasourcesourcebuffermodeexpectedtxt">trunk/LayoutTests/platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutablecpp">trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutableh">trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserASTBuilderh">trunk/Source/JavaScriptCore/parser/ASTBuilder.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserNodesh">trunk/Source/JavaScriptCore/parser/Nodes.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExecutableh">trunk/Source/JavaScriptCore/runtime/Executable.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSFunctioncpp">trunk/Source/JavaScriptCore/runtime/JSFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoretestses6yaml">trunk/Source/JavaScriptCore/tests/es6.yaml</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/LayoutTests/ChangeLog        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-03-09  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        FunctionExecutable::ecmaName() should not be based on inferredName().
+        https://bugs.webkit.org/show_bug.cgi?id=155203
+
+        Reviewed by Michael Saboff.
+
+        * js/script-tests/function-toString-vs-name.js:
+        - Fixed up object property test section and added new test cases.
+        * platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt:
+
</ins><span class="cx"> 2016-03-09  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Align HTMLKeygenElement.keytype with the specification
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsfunctiontoStringvsnamejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/function-toString-vs-name.js (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/function-toString-vs-name.js        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/LayoutTests/js/script-tests/function-toString-vs-name.js        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -158,15 +158,6 @@
</span><span class="cx">     }) ();
</span><span class="cx">     test(foo4, &quot;&quot;, &quot;function() {}&quot;);
</span><span class="cx"> 
</span><del>-    // Test functions in object properties.
-    section = &quot;Object property&quot;;
-    let o = {
-        prop1: function() {},
-        prop2: function namedProp2() {}
-    };
-    test(o.prop1, &quot;prop1&quot;, &quot;function() {}&quot;);
-    test(o.prop2, &quot;namedProp2&quot;, &quot;function namedProp2() {}&quot;);
-
</del><span class="cx">     section = &quot;bound JS function&quot;;
</span><span class="cx">     {
</span><span class="cx">         let o = {}
</span><span class="lines">@@ -183,6 +174,32 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+section = &quot;Object property&quot;;
+{
+    let o = {
+        prop1: function() {},
+        prop2: function namedProp2() {}
+    };
+    o.prop3 = function() { };
+    o.prop4 = function namedProp4() {};
+    test(o.prop1, &quot;prop1&quot;, &quot;function() {}&quot;);
+    test(o.prop2, &quot;namedProp2&quot;, &quot;function namedProp2() {}&quot;);
+    test(o.prop3, &quot;&quot;, &quot;function() {}&quot;);
+    test(o.prop4, &quot;namedProp4&quot;, &quot;function namedProp4() {}&quot;);
+
+    section = &quot;bound Object property&quot;;
+    {
+        let boundProp1 = o.prop1.bind({});
+        test(boundProp1, &quot;bound prop1&quot;, &quot;function prop1() { [native code] }&quot;);
+        let boundFoo2 = o.prop2.bind({});
+        test(boundFoo2, &quot;bound namedProp2&quot;, &quot;function namedProp2() { [native code] }&quot;);
+        let boundFoo3 = o.prop3.bind({});
+        test(boundFoo3, &quot;bound &quot;, &quot;function() { [native code] }&quot;);
+        let boundFoo4 = o.prop4.bind({});
+        test(boundFoo4, &quot;bound namedProp4&quot;, &quot;function namedProp4() { [native code] }&quot;);
+    }
+}
+
</ins><span class="cx"> section = &quot;object shorthand method&quot;;
</span><span class="cx"> {
</span><span class="cx">     let o = {
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmachttptestsmediamediasourcemediasourcesourcebuffermodeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/LayoutTests/platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> assert_throws@http://127.0.0.1:8000/w3c/resources/testharness.js:947:19
</span><span class="cx"> http://127.0.0.1:8000/media/media-source/mediasource-sourcebuffer-mode.html:114:32
</span><span class="cx"> handleWaitCallback_@http://127.0.0.1:8000/media/media-source/mediasource-util.js:97:17
</span><del>-handleWaitCallback_@[native code]
</del><ins>+[native code]
</ins><span class="cx"> step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
</span><span class="cx"> http://127.0.0.1:8000/w3c/resources/testharness.js:1189:33)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2016-03-09  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        FunctionExecutable::ecmaName() should not be based on inferredName().
+        https://bugs.webkit.org/show_bug.cgi?id=155203
+
+        Reviewed by Michael Saboff.
+
+        The ES6 rules for how a function name should be inferred closely matches JSC's
+        implementation with one exception:
+            var o = {}
+            o.foo = function() {}
+
+        JSC's inferredName for o.foo would be &quot;foo&quot;.
+        ES6 specifies that o.foo.name is &quot;&quot;.
+
+        The fix is to add a distinct FunctionExecutable::ecmaName() which applies the ES6
+        rules for inferring the initial value of Function.name.
+
+        * bytecode/UnlinkedFunctionExecutable.cpp:
+        (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
+        * bytecode/UnlinkedFunctionExecutable.h:
+        * parser/ASTBuilder.h:
+        (JSC::ASTBuilder::createAssignResolve):
+        (JSC::ASTBuilder::createGetterOrSetterProperty):
+        (JSC::ASTBuilder::createProperty):
+        (JSC::ASTBuilder::makeAssignNode):
+        * parser/Nodes.h:
+        * runtime/Executable.h:
+        * runtime/JSFunction.cpp:
+        (JSC::JSFunction::reifyName):
+        * tests/es6.yaml:
+
</ins><span class="cx"> 2016-03-09  Michael Saboff  &lt;msaboff@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Harden JSC Root element functions from bad values
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -102,6 +102,7 @@
</span><span class="cx">     , m_derivedContextType(static_cast&lt;unsigned&gt;(derivedContextType))
</span><span class="cx">     , m_sourceParseMode(static_cast&lt;unsigned&gt;(node-&gt;parseMode()))
</span><span class="cx">     , m_name(node-&gt;ident())
</span><ins>+    , m_ecmaName(node-&gt;ecmaName())
</ins><span class="cx">     , m_inferredName(node-&gt;inferredName())
</span><span class="cx">     , m_sourceOverride(WTFMove(sourceOverride))
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const Identifier&amp; name() const { return m_name; }
</span><ins>+    const Identifier&amp; ecmaName() const { return m_ecmaName; }
</ins><span class="cx">     const Identifier&amp; inferredName() const { return m_inferredName; }
</span><span class="cx">     unsigned parameterCount() const { return m_parameterCount; };
</span><span class="cx">     SourceParseMode parseMode() const { return static_cast&lt;SourceParseMode&gt;(m_sourceParseMode); };
</span><span class="lines">@@ -159,6 +160,7 @@
</span><span class="cx">     WriteBarrier&lt;UnlinkedFunctionCodeBlock&gt; m_unlinkedCodeBlockForConstruct;
</span><span class="cx"> 
</span><span class="cx">     Identifier m_name;
</span><ins>+    Identifier m_ecmaName;
</ins><span class="cx">     Identifier m_inferredName;
</span><span class="cx">     RefPtr&lt;SourceProvider&gt; m_sourceOverride;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserASTBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/ASTBuilder.h (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/ASTBuilder.h        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/Source/JavaScriptCore/parser/ASTBuilder.h        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -341,8 +341,11 @@
</span><span class="cx"> 
</span><span class="cx">     ExpressionNode* createAssignResolve(const JSTokenLocation&amp; location, const Identifier&amp; ident, ExpressionNode* rhs, const JSTextPosition&amp; start, const JSTextPosition&amp; divot, const JSTextPosition&amp; end, AssignmentContext assignmentContext)
</span><span class="cx">     {
</span><del>-        if (rhs-&gt;isFuncExprNode() || rhs-&gt;isArrowFuncExprNode())
-            static_cast&lt;FuncExprNode*&gt;(rhs)-&gt;metadata()-&gt;setInferredName(ident);
</del><ins>+        if (rhs-&gt;isFuncExprNode() || rhs-&gt;isArrowFuncExprNode()) {
+            auto metadata = static_cast&lt;FuncExprNode*&gt;(rhs)-&gt;metadata();
+            metadata-&gt;setEcmaName(ident);
+            metadata-&gt;setInferredName(ident);
+        }
</ins><span class="cx">         AssignResolveNode* node = new (m_parserArena) AssignResolveNode(location, ident, rhs, assignmentContext);
</span><span class="cx">         setExceptionLocation(node, start, divot, end);
</span><span class="cx">         return node;
</span><span class="lines">@@ -400,6 +403,7 @@
</span><span class="cx">     {
</span><span class="cx">         ASSERT(name);
</span><span class="cx">         functionInfo.body-&gt;setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset);
</span><ins>+        functionInfo.body-&gt;setEcmaName(*name);
</ins><span class="cx">         functionInfo.body-&gt;setInferredName(*name);
</span><span class="cx">         SourceCode source = m_sourceCode-&gt;subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn);
</span><span class="cx">         FuncExprNode* funcExpr = new (m_parserArena) FuncExprNode(location, m_vm-&gt;propertyNames-&gt;nullIdentifier, functionInfo.body, source);
</span><span class="lines">@@ -433,8 +437,11 @@
</span><span class="cx"> 
</span><span class="cx">     PropertyNode* createProperty(const Identifier* propertyName, ExpressionNode* node, PropertyNode::Type type, PropertyNode::PutType putType, bool, SuperBinding superBinding = SuperBinding::NotNeeded)
</span><span class="cx">     {
</span><del>-        if (node-&gt;isFuncExprNode())
-            static_cast&lt;FuncExprNode*&gt;(node)-&gt;metadata()-&gt;setInferredName(*propertyName);
</del><ins>+        if (node-&gt;isFuncExprNode()) {
+            auto metadata = static_cast&lt;FuncExprNode*&gt;(node)-&gt;metadata();
+            metadata-&gt;setEcmaName(*propertyName);
+            metadata-&gt;setInferredName(*propertyName);
+        }
</ins><span class="cx">         return new (m_parserArena) PropertyNode(*propertyName, node, type, putType, superBinding);
</span><span class="cx">     }
</span><span class="cx">     PropertyNode* createProperty(VM* vm, ParserArena&amp; parserArena, double propertyName, ExpressionNode* node, PropertyNode::Type type, PropertyNode::PutType putType, bool)
</span><span class="lines">@@ -1290,8 +1297,11 @@
</span><span class="cx">     if (loc-&gt;isResolveNode()) {
</span><span class="cx">         ResolveNode* resolve = static_cast&lt;ResolveNode*&gt;(loc);
</span><span class="cx">         if (op == OpEqual) {
</span><del>-            if (expr-&gt;isFuncExprNode())
-                static_cast&lt;FuncExprNode*&gt;(expr)-&gt;metadata()-&gt;setInferredName(resolve-&gt;identifier());
</del><ins>+            if (expr-&gt;isFuncExprNode()) {
+                auto metadata = static_cast&lt;FuncExprNode*&gt;(expr)-&gt;metadata();
+                metadata-&gt;setEcmaName(resolve-&gt;identifier());
+                metadata-&gt;setInferredName(resolve-&gt;identifier());
+            }
</ins><span class="cx">             AssignResolveNode* node = new (m_parserArena) AssignResolveNode(location, resolve-&gt;identifier(), expr, AssignmentContext::AssignmentExpression);
</span><span class="cx">             setExceptionLocation(node, start, divot, end);
</span><span class="cx">             return node;
</span><span class="lines">@@ -1309,8 +1319,11 @@
</span><span class="cx">     ASSERT(loc-&gt;isDotAccessorNode());
</span><span class="cx">     DotAccessorNode* dot = static_cast&lt;DotAccessorNode*&gt;(loc);
</span><span class="cx">     if (op == OpEqual) {
</span><del>-        if (expr-&gt;isFuncExprNode())
</del><ins>+        if (expr-&gt;isFuncExprNode()) {
+            // We don't also set the ecma name here because ES6 specifies that the
+            // function should not pick up the name of the dot-&gt;identifier().
</ins><span class="cx">             static_cast&lt;FuncExprNode*&gt;(expr)-&gt;metadata()-&gt;setInferredName(dot-&gt;identifier());
</span><ins>+        }
</ins><span class="cx">         return new (m_parserArena) AssignDotNode(location, dot-&gt;base(), dot-&gt;identifier(), expr, exprHasAssignments, dot-&gt;divot(), start, end);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Nodes.h (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Nodes.h        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/Source/JavaScriptCore/parser/Nodes.h        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -1841,6 +1841,8 @@
</span><span class="cx">         
</span><span class="cx">         void overrideName(const Identifier&amp; ident) { m_ident = ident; }
</span><span class="cx">         const Identifier&amp; ident() { return m_ident; }
</span><ins>+        void setEcmaName(const Identifier&amp; ecmaName) { ASSERT(!ecmaName.isNull()); m_ecmaName = ecmaName; }
+        const Identifier&amp; ecmaName() { return m_ident.isEmpty() ? m_ecmaName : m_ident; }
</ins><span class="cx">         void setInferredName(const Identifier&amp; inferredName) { ASSERT(!inferredName.isNull()); m_inferredName = inferredName; }
</span><span class="cx">         const Identifier&amp; inferredName() { return m_inferredName.isEmpty() ? m_ident : m_inferredName; }
</span><span class="cx"> 
</span><span class="lines">@@ -1874,6 +1876,7 @@
</span><span class="cx"> 
</span><span class="cx">     protected:
</span><span class="cx">         Identifier m_ident;
</span><ins>+        Identifier m_ecmaName;
</ins><span class="cx">         Identifier m_inferredName;
</span><span class="cx">         FunctionMode m_functionMode;
</span><span class="cx">         unsigned m_startColumn;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Executable.h (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Executable.h        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/Source/JavaScriptCore/runtime/Executable.h        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -668,10 +668,8 @@
</span><span class="cx">     DerivedContextType derivedContextType() const { return m_unlinkedExecutable-&gt;derivedContextType(); }
</span><span class="cx">     bool isClassConstructorFunction() const { return m_unlinkedExecutable-&gt;isClassConstructorFunction(); }
</span><span class="cx">     const Identifier&amp; name() { return m_unlinkedExecutable-&gt;name(); }
</span><ins>+    const Identifier&amp; ecmaName() { return m_unlinkedExecutable-&gt;ecmaName(); }
</ins><span class="cx">     const Identifier&amp; inferredName() { return m_unlinkedExecutable-&gt;inferredName(); }
</span><del>-    // FIXME: ecmaName() needs to be reimplement to be based on ES6 rules of determining the inferred
-    // Function.name from non-computed names. https://bugs.webkit.org/show_bug.cgi?id=155203
-    const Identifier&amp; ecmaName() { return inferredName(); }
</del><span class="cx">     size_t parameterCount() const { return m_unlinkedExecutable-&gt;parameterCount(); } // Excluding 'this'!
</span><span class="cx">     SourceParseMode parseMode() const { return m_unlinkedExecutable-&gt;parseMode(); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSFunction.cpp (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSFunction.cpp        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/Source/JavaScriptCore/runtime/JSFunction.cpp        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -595,10 +595,7 @@
</span><span class="cx">     unsigned initialAttributes = DontEnum | ReadOnly;
</span><span class="cx">     const Identifier&amp; propID = exec-&gt;propertyNames().name;
</span><span class="cx"> 
</span><del>-    const Identifier&amp; nameID = jsExecutable()-&gt;name();
-    String name = nameID.string();
-    if (name.isEmpty())
-        name = jsExecutable()-&gt;ecmaName().string();
</del><ins>+    String name = jsExecutable()-&gt;ecmaName().string();
</ins><span class="cx"> 
</span><span class="cx">     if (jsExecutable()-&gt;isGetter())
</span><span class="cx">         name = makeString(&quot;get &quot;, name);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestses6yaml"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/es6.yaml (197866 => 197867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/es6.yaml        2016-03-09 19:29:29 UTC (rev 197866)
+++ trunk/Source/JavaScriptCore/tests/es6.yaml        2016-03-09 19:36:21 UTC (rev 197867)
</span><span class="lines">@@ -803,7 +803,7 @@
</span><span class="cx"> - path: es6/function_name_property_object_methods_class.js
</span><span class="cx">   cmd: runES6 :fail
</span><span class="cx"> - path: es6/function_name_property_object_methods_function.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/function_name_property_shorthand_methods_no_lexical_binding.js
</span><span class="cx">   cmd: runES6 :fail
</span><span class="cx"> - path: es6/function_name_property_symbol-keyed_methods.js
</span></span></pre>
</div>
</div>

</body>
</html>