<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 &quot;super&quot; property"
   href="https://bugs.webkit.org/show_bug.cgi?id=149615#c13">Comment # 13</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Arrow function syntax. Arrow function specific features. Lexical bind &quot;super&quot; property"
   href="https://bugs.webkit.org/show_bug.cgi?id=149615">bug 149615</a>
              from <span class="vcard"><a class="email" href="mailto:sbarati&#64;apple.com" title="Saam Barati &lt;sbarati&#64;apple.com&gt;"> <span class="fn">Saam Barati</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=267799&amp;action=diff" name="attach_267799" title="Patch">attachment 267799</a> <a href="attachment.cgi?id=267799&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=267799&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=267799&amp;action=review</a>

<span class="quote">&gt; Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp:69
&gt; +    // this executable is part of the class</span >

comment isn't needed

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:575
&gt; +    if (SourceParseMode::ArrowFunctionMode == parseMode &amp;&amp; (functionNode-&gt;usesThis() || isDerivedClassContext() || isDerivedConstructorContext()))</span >

Why are these new conditions needed?
Why do we need to load this if we're &quot;SourceParseMode::ArrowFunctionMode == parseMode &amp;&amp; (isDerivedClassContext() || isDerivedConstructorContext())&quot;?

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4050
&gt; +    if ((isConstructor() &amp;&amp; constructorKind() == ConstructorKind::Derived) || (m_codeBlock-&gt;isClassContext())) {</span >

style: the parens around &quot;m_codeBlock-&gt;isClassContext()&quot; aren't needed.

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:813
&gt; +                bool newisDerivedConstructorContext = constructorKind() == ConstructorKind::Derived || (derivedContextType() == DerivedContextType::DerivedConstructorContext);
&gt; +            
&gt; +                if (newisDerivedConstructorContext)
&gt; +                    newDerivedContextType = DerivedContextType::DerivedConstructorContext;
&gt; +                else  {
&gt; +                    bool isArrowFunctionInClassContext = m_codeBlock-&gt;isClassContext() || (m_codeBlock-&gt;isArrowFunction() &amp;&amp; m_derivedContextType == DerivedContextType::DerivedMethodContext);
&gt; +                    newDerivedContextType = isArrowFunctionInClassContext ? DerivedContextType::DerivedMethodContext : DerivedContextType::None;
&gt; +                }</span >

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-&gt;isClassContext() || (m_codeBlock-&gt;isArrowFunction() &amp;&amp; m_derivedContextType == DerivedContextType::DerivedMethodContext))
    newDerivedContextType =  DerivedContextType::DerivedMethodContext
```

Also, why do we need to check &quot;m_codeBlock-&gt;isArrowFunction()&quot; when checking &quot;m_derivedContextType == DerivedContextType::DerivedMethodContext&quot;?
When would we have &quot;!m_codeBlock-&gt;isArrowFunction() &amp;&amp; m_derivedContextType == DerivedContextType::DerivedMethodContext&quot;?

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:182
&gt; +        RegisterID* scope = generator.emitLoadDerivedConstructorFromArrowFunctionLexicalEnvironment();    </span >

This isn't a JSScope. Maybe a better variable name is &quot;derivedConstructor&quot; or something similar.

<span class="quote">&gt; Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp:195
&gt; +    EvalExecutable* eval = EvalExecutable::create(callFrame, makeSource(script), codeBlock.isStrictMode(), thisTDZMode, codeBlock.unlinkedCodeBlock()-&gt;derivedContextType(), codeBlock.unlinkedCodeBlock()-&gt;isArrowFunction(), &amp;variablesUnderTDZ);</span >

have you tried this out inside the inspector to make sure it works?
I.e, pausing inside an arrow function and typing in &quot;super&quot; into the console?

<span class="quote">&gt; Source/JavaScriptCore/tests/stress/arrowfunction-lexical-bind-superproperty.js:160
&gt; +      erorr = true;</span >

typo: &quot;erorr&quot; =&gt; &quot;error&quot;

<span class="quote">&gt; Source/JavaScriptCore/tests/stress/arrowfunction-lexical-bind-superproperty.js:162
&gt; +    testCase(erorr, true, 'Error: using &quot;super&quot; should lead to error');</span >

ditto

<span class="quote">&gt; LayoutTests/js/script-tests/arrowfunction-superproperty.js:78
&gt; +// FIXME: Problem with access to the super before super in constructor</span >

nit: &quot;super before super&quot; =&gt; &quot;super before super()&quot;</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>