[Webkit-unassigned] [Bug 149615] [ES6] Arrow function syntax. Arrow function specific features. Lexical bind "super" property

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 29 16:32:45 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=149615

--- Comment #18 from Saam Barati <sbarati at apple.com> ---
Comment on attachment 267799
  --> https://bugs.webkit.org/attachment.cgi?id=267799
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=267799&action=review

>>> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:813
>>> +                }
>> 
>> Nit: I think this whole section of code would be easier to read like this:
>> ```
>> if (constructorKind() == ConstructorKind::Derived || isDerivedConstructorContext())
>>     newDerivedContextType = DerivedContextType::DerivedConstructorContext;
>> else if (m_codeBlock->isClassContext() || (m_codeBlock->isArrowFunction() && m_derivedContextType == DerivedContextType::DerivedMethodContext))
>>     newDerivedContextType =  DerivedContextType::DerivedMethodContext
>> ```
>> 
>> Also, why do we need to check "m_codeBlock->isArrowFunction()" when checking "m_derivedContextType == DerivedContextType::DerivedMethodContext"?
>> When would we have "!m_codeBlock->isArrowFunction() && m_derivedContextType == DerivedContextType::DerivedMethodContext"?
> 
> Ohh, I see. We don't need to check m_codeBlock->isArrowFunction() because it already true because of this condition metadata->parseMode() == SourceParseMode::ArrowFunctionMode.

No, that's not true.
m_codeBlock is the function we're generating code for. metadata is the inner function we're creating.
We could have 'metadata->parseMode() == ArrowFunctionMode' but also have m_codeBlock be the global scope or an eval or a regular function.
The interesting thing here is m_derivedContextType.

My question is this:
Does 'm_derivedContextType == DerivedContextType::DerivedMethodSyntax' imply that 'm_codeBlock->isArrowFunction()'?
If that statement is not true, when would we have 'm_derivedContextType == DerivedContextType::DerivedMethodSyntax' but also have '!m_codeBlock->isArrowFunction()'.
Is that even possible to have DerivedMethodSyntax when the parent function is not an arrow function? This seems like it should be impossible.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151230/42cc787c/attachment.html>


More information about the webkit-unassigned mailing list