https://bugs.webkit.org/show_bug.cgi?id=162720
Reviewed by Saam Barati.
JSTests:
* stress/inferred-names.js:
Source/JavaScriptCore:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitSetFunctionNameIfNeeded):
Set function name on arrow functions as well.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206610
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2016-09-29 Joseph Pecoraro <pecoraro@apple.com>
+
+ Arrow functions do not infer name from computed property but normal functions do
+ https://bugs.webkit.org/show_bug.cgi?id=162720
+
+ Reviewed by Saam Barati.
+
+ * stress/inferred-names.js:
+
2016-09-29 Mark Lam <mark.lam@apple.com>
Break some slow running tests into smaller bits so they don't time out.
assert( ({"func": ()=>{}}).func.name === "func" );
assert( ({func: ()=>{}}).func.name === "func" );
-// FIXME: <https://webkit.org/b/162720> Arrow functions do not infer name from computed property but normal functions do
-// assert( ({["func"]: ()=>{}}).func.name === "func" );
-// assert( ({[funcName()]: ()=>{}}).func.name === "func" );
+assert( ({["func"]: ()=>{}}).func.name === "func" );
+assert( ({[funcName()]: ()=>{}}).func.name === "func" );
assert( ({"klass": class{}}).klass.name === "klass" );
assert( ({klass: class{}}).klass.name === "klass" );
2016-09-29 Joseph Pecoraro <pecoraro@apple.com>
+ Arrow functions do not infer name from computed property but normal functions do
+ https://bugs.webkit.org/show_bug.cgi?id=162720
+
+ Reviewed by Saam Barati.
+
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::emitSetFunctionNameIfNeeded):
+ Set function name on arrow functions as well.
+
+2016-09-29 Joseph Pecoraro <pecoraro@apple.com>
+
test262: class and function names should be inferred in assignment
https://bugs.webkit.org/show_bug.cgi?id=146262
void BytecodeGenerator::emitSetFunctionNameIfNeeded(ExpressionNode* valueNode, RegisterID* value, RegisterID* name)
{
- if (valueNode->isFuncExprNode()) {
- FunctionMetadataNode* metadata = static_cast<FuncExprNode*>(valueNode)->metadata();
+ if (valueNode->isBaseFuncExprNode()) {
+ FunctionMetadataNode* metadata = static_cast<BaseFuncExprNode*>(valueNode)->metadata();
if (!metadata->ecmaName().isNull())
return;
} else if (valueNode->isClassExprNode()) {