<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Invoking super()/super inside of the eval should not lead to SyntaxError"
   href="https://bugs.webkit.org/show_bug.cgi?id=153864#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Invoking super()/super inside of the eval should not lead to SyntaxError"
   href="https://bugs.webkit.org/show_bug.cgi?id=153864">bug 153864</a>
              from <span class="vcard"><a class="email" href="mailto:gskachkov&#64;gmail.com" title="GSkachkov &lt;gskachkov&#64;gmail.com&gt;"> <span class="fn">GSkachkov</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=274093&amp;action=diff" name="attach_274093" title="Patch">attachment 274093</a> <a href="attachment.cgi?id=274093&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt;&gt; Source/JavaScriptCore/ChangeLog:3
&gt;&gt; +        Invoking super()/super inside of the eval should not lead to SyntaxError
&gt; 
&gt; Do we have a bug open for new.target inside eval?</span >

Yes, I did this recently
 <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Class syntax. Access to new.target inside of the eval should not lead to SyntaxError"
   href="show_bug.cgi?id=155545">https://bugs.webkit.org/show_bug.cgi?id=155545</a>

<span class="quote">&gt;&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:643
&gt;&gt;&gt; +    if (needsToUpdateArrowFunctionContext() &amp;&amp; !codeBlock-&gt;isArrowFunctionContext() &amp;&amp; !isDerivedConstructorContext()) {
&gt;&gt; 
&gt;&gt; Why the &quot;!isDerivedConstructorContext()&quot; check?
&gt; 
&gt; Ah, I guess it's that way so we don't recreate a scope. I think I understand.</span >

Yes, that is correct. It is for this case: 
class C {};
class D extends C {
  constructor() {
    eval(&quot;(()=&gt;super())()&quot;);//Error
  }
}
new D();
Otherwise we will have two context scope for 'this'. I've spend last three evenings to find out why mention simple test case did not work

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4145
&gt;&gt; +    return m_scopeNode-&gt;doAnyInnerArrowFunctionsUseNewTarget() || m_scopeNode-&gt;doAnyInnerArrowFunctionsUseSuperCall() || m_scopeNode-&gt;doAnyInnerArrowFunctionsUseEval() || m_codeBlock-&gt;usesEval();
&gt; 
&gt; I believe m_codeBlock-&gt;usesEval() should always be true if m_scopeNode-&gt;doAnyInnerAroowFunctionsUseEval().
&gt; You should double check though.</span >

It is true, but unfortunately this patch cover cases when we do not have arrow function, for instance from previous comments, so I need to check m_codeBlock-&gt;usesEval(). Possible we need to change name of the function isNewTargetUsedInInnerArrowFunction -&gt; isNewTargetUsedInInnerArrowFunctionOrEval

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4150
&gt;&gt; +    return m_scopeNode-&gt;doAnyInnerArrowFunctionsUseSuperCall() || m_scopeNode-&gt;doAnyInnerArrowFunctionsUseSuperProperty() || m_scopeNode-&gt;doAnyInnerArrowFunctionsUseEval() || m_codeBlock-&gt;usesEval();
&gt; 
&gt; ditto</span >

The same

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4155
&gt;&gt; +    return m_scopeNode-&gt;doAnyInnerArrowFunctionsUseSuperCall() || m_scopeNode-&gt;doAnyInnerArrowFunctionsUseEval() || m_codeBlock-&gt;usesEval();
&gt; 
&gt; ditto</span >

The same

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:3848
&gt;&gt; +        // TODO: Change error message for more suitable. <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Arrow function syntax. Update syntax error text 'super is only valid inside functions' to more suitable"
   href="show_bug.cgi?id=155491">https://bugs.webkit.org/show_bug.cgi?id=155491</a> 
&gt; 
&gt; Style: FIXME not TODO</span >

Will be updated in next patch.</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>