<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES6] Arrow function syntax. Arrow function specific features. Lexical bind "super" property"
href="https://bugs.webkit.org/show_bug.cgi?id=149615#c18">Comment # 18</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES6] Arrow function syntax. Arrow function specific features. Lexical bind "super" property"
href="https://bugs.webkit.org/show_bug.cgi?id=149615">bug 149615</a>
from <span class="vcard"><a class="email" href="mailto:sbarati@apple.com" title="Saam Barati <sbarati@apple.com>"> <span class="fn">Saam Barati</span></a>
</span></b>
<pre>Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=267799&action=diff" name="attach_267799" title="Patch">attachment 267799</a> <a href="attachment.cgi?id=267799&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=267799&action=review">https://bugs.webkit.org/attachment.cgi?id=267799&action=review</a>
<span class="quote">>>> 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.</span >
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>