<!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 "foo".
ES6 specifies that o.foo.name is "".
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 <mark.lam@apple.com>
+
+ 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 <cdumez@apple.com>
</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, "", "function() {}");
</span><span class="cx">
</span><del>- // Test functions in object properties.
- section = "Object property";
- let o = {
- prop1: function() {},
- prop2: function namedProp2() {}
- };
- test(o.prop1, "prop1", "function() {}");
- test(o.prop2, "namedProp2", "function namedProp2() {}");
-
</del><span class="cx"> section = "bound JS function";
</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 = "Object property";
+{
+ let o = {
+ prop1: function() {},
+ prop2: function namedProp2() {}
+ };
+ o.prop3 = function() { };
+ o.prop4 = function namedProp4() {};
+ test(o.prop1, "prop1", "function() {}");
+ test(o.prop2, "namedProp2", "function namedProp2() {}");
+ test(o.prop3, "", "function() {}");
+ test(o.prop4, "namedProp4", "function namedProp4() {}");
+
+ section = "bound Object property";
+ {
+ let boundProp1 = o.prop1.bind({});
+ test(boundProp1, "bound prop1", "function prop1() { [native code] }");
+ let boundFoo2 = o.prop2.bind({});
+ test(boundFoo2, "bound namedProp2", "function namedProp2() { [native code] }");
+ let boundFoo3 = o.prop3.bind({});
+ test(boundFoo3, "bound ", "function() { [native code] }");
+ let boundFoo4 = o.prop4.bind({});
+ test(boundFoo4, "bound namedProp4", "function namedProp4() { [native code] }");
+ }
+}
+
</ins><span class="cx"> section = "object shorthand method";
</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 <mark.lam@apple.com>
+
+ 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 "foo".
+ ES6 specifies that o.foo.name is "".
+
+ 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 <msaboff@apple.com>
</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<unsigned>(derivedContextType))
</span><span class="cx"> , m_sourceParseMode(static_cast<unsigned>(node->parseMode()))
</span><span class="cx"> , m_name(node->ident())
</span><ins>+ , m_ecmaName(node->ecmaName())
</ins><span class="cx"> , m_inferredName(node->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& name() const { return m_name; }
</span><ins>+ const Identifier& ecmaName() const { return m_ecmaName; }
</ins><span class="cx"> const Identifier& 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<SourceParseMode>(m_sourceParseMode); };
</span><span class="lines">@@ -159,6 +160,7 @@
</span><span class="cx"> WriteBarrier<UnlinkedFunctionCodeBlock> 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<SourceProvider> 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& location, const Identifier& ident, ExpressionNode* rhs, const JSTextPosition& start, const JSTextPosition& divot, const JSTextPosition& end, AssignmentContext assignmentContext)
</span><span class="cx"> {
</span><del>- if (rhs->isFuncExprNode() || rhs->isArrowFuncExprNode())
- static_cast<FuncExprNode*>(rhs)->metadata()->setInferredName(ident);
</del><ins>+ if (rhs->isFuncExprNode() || rhs->isArrowFuncExprNode()) {
+ auto metadata = static_cast<FuncExprNode*>(rhs)->metadata();
+ metadata->setEcmaName(ident);
+ metadata->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->setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset);
</span><ins>+ functionInfo.body->setEcmaName(*name);
</ins><span class="cx"> functionInfo.body->setInferredName(*name);
</span><span class="cx"> SourceCode source = m_sourceCode->subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn);
</span><span class="cx"> FuncExprNode* funcExpr = new (m_parserArena) FuncExprNode(location, m_vm->propertyNames->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->isFuncExprNode())
- static_cast<FuncExprNode*>(node)->metadata()->setInferredName(*propertyName);
</del><ins>+ if (node->isFuncExprNode()) {
+ auto metadata = static_cast<FuncExprNode*>(node)->metadata();
+ metadata->setEcmaName(*propertyName);
+ metadata->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& 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->isResolveNode()) {
</span><span class="cx"> ResolveNode* resolve = static_cast<ResolveNode*>(loc);
</span><span class="cx"> if (op == OpEqual) {
</span><del>- if (expr->isFuncExprNode())
- static_cast<FuncExprNode*>(expr)->metadata()->setInferredName(resolve->identifier());
</del><ins>+ if (expr->isFuncExprNode()) {
+ auto metadata = static_cast<FuncExprNode*>(expr)->metadata();
+ metadata->setEcmaName(resolve->identifier());
+ metadata->setInferredName(resolve->identifier());
+ }
</ins><span class="cx"> AssignResolveNode* node = new (m_parserArena) AssignResolveNode(location, resolve->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->isDotAccessorNode());
</span><span class="cx"> DotAccessorNode* dot = static_cast<DotAccessorNode*>(loc);
</span><span class="cx"> if (op == OpEqual) {
</span><del>- if (expr->isFuncExprNode())
</del><ins>+ if (expr->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->identifier().
</ins><span class="cx"> static_cast<FuncExprNode*>(expr)->metadata()->setInferredName(dot->identifier());
</span><ins>+ }
</ins><span class="cx"> return new (m_parserArena) AssignDotNode(location, dot->base(), dot->identifier(), expr, exprHasAssignments, dot->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& ident) { m_ident = ident; }
</span><span class="cx"> const Identifier& ident() { return m_ident; }
</span><ins>+ void setEcmaName(const Identifier& ecmaName) { ASSERT(!ecmaName.isNull()); m_ecmaName = ecmaName; }
+ const Identifier& ecmaName() { return m_ident.isEmpty() ? m_ecmaName : m_ident; }
</ins><span class="cx"> void setInferredName(const Identifier& inferredName) { ASSERT(!inferredName.isNull()); m_inferredName = inferredName; }
</span><span class="cx"> const Identifier& 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->derivedContextType(); }
</span><span class="cx"> bool isClassConstructorFunction() const { return m_unlinkedExecutable->isClassConstructorFunction(); }
</span><span class="cx"> const Identifier& name() { return m_unlinkedExecutable->name(); }
</span><ins>+ const Identifier& ecmaName() { return m_unlinkedExecutable->ecmaName(); }
</ins><span class="cx"> const Identifier& inferredName() { return m_unlinkedExecutable->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& ecmaName() { return inferredName(); }
</del><span class="cx"> size_t parameterCount() const { return m_unlinkedExecutable->parameterCount(); } // Excluding 'this'!
</span><span class="cx"> SourceParseMode parseMode() const { return m_unlinkedExecutable->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& propID = exec->propertyNames().name;
</span><span class="cx">
</span><del>- const Identifier& nameID = jsExecutable()->name();
- String name = nameID.string();
- if (name.isEmpty())
- name = jsExecutable()->ecmaName().string();
</del><ins>+ String name = jsExecutable()->ecmaName().string();
</ins><span class="cx">
</span><span class="cx"> if (jsExecutable()->isGetter())
</span><span class="cx"> name = makeString("get ", 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>