Changeset 206610 in webkit


Ignore:
Timestamp:
Sep 29, 2016, 1:33:21 PM (9 years ago)
Author:
Joseph Pecoraro
Message:

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.

JSTests:

  • stress/inferred-names.js:

Source/JavaScriptCore:

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitSetFunctionNameIfNeeded):
Set function name on arrow functions as well.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r206600 r206610  
     12016-09-29  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Arrow functions do not infer name from computed property but normal functions do
     4        https://bugs.webkit.org/show_bug.cgi?id=162720
     5
     6        Reviewed by Saam Barati.
     7
     8        * stress/inferred-names.js:
     9
    1102016-09-29  Mark Lam  <mark.lam@apple.com>
    211
  • trunk/JSTests/stress/inferred-names.js

    r206599 r206610  
    7171assert( ({"func": ()=>{}}).func.name === "func" );
    7272assert( ({func: ()=>{}}).func.name === "func" );
    73 // FIXME: <https://webkit.org/b/162720> Arrow functions do not infer name from computed property but normal functions do
    74 // assert( ({["func"]: ()=>{}}).func.name === "func" );
    75 // assert( ({[funcName()]: ()=>{}}).func.name === "func" );
     73assert( ({["func"]: ()=>{}}).func.name === "func" );
     74assert( ({[funcName()]: ()=>{}}).func.name === "func" );
    7675
    7776assert( ({"klass": class{}}).klass.name === "klass" );
  • trunk/Source/JavaScriptCore/ChangeLog

    r206599 r206610  
     12016-09-29  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Arrow functions do not infer name from computed property but normal functions do
     4        https://bugs.webkit.org/show_bug.cgi?id=162720
     5
     6        Reviewed by Saam Barati.
     7
     8        * bytecompiler/BytecodeGenerator.cpp:
     9        (JSC::BytecodeGenerator::emitSetFunctionNameIfNeeded):
     10        Set function name on arrow functions as well.
     11
    1122016-09-29  Joseph Pecoraro  <pecoraro@apple.com>
    213
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r206333 r206610  
    30453045void BytecodeGenerator::emitSetFunctionNameIfNeeded(ExpressionNode* valueNode, RegisterID* value, RegisterID* name)
    30463046{
    3047     if (valueNode->isFuncExprNode()) {
    3048         FunctionMetadataNode* metadata = static_cast<FuncExprNode*>(valueNode)->metadata();
     3047    if (valueNode->isBaseFuncExprNode()) {
     3048        FunctionMetadataNode* metadata = static_cast<BaseFuncExprNode*>(valueNode)->metadata();
    30493049        if (!metadata->ecmaName().isNull())
    30503050            return;
Note: See TracChangeset for help on using the changeset viewer.