<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#c5">Comment # 5</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="bz_obsolete"><a href="attachment.cgi?id=273142&amp;action=diff" name="attach_273142" title="Patch">attachment 273142</a> <a href="attachment.cgi?id=273142&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:307
&gt;&gt;                  ? m_newTargetRegister : emitLoadNewTargetFromArrowFunctionLexicalEnvironment();
&gt; 
&gt; This function is getting hard to read. I vote for an if statement here.
&gt; Also, I found a bug in the logic of caching here:
&gt; <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - How we load new.target in arrow functions is broken"
   href="show_bug.cgi?id=155153">https://bugs.webkit.org/show_bug.cgi?id=155153</a></span >

OK. It will be overwritten in fix of the 155153

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:2068
&gt;&gt; +            ConstructorKind functionConstructorKind = functionBodyType == StandardFunctionBodyBlock &amp;&amp; !m_isEvalContext
&gt; 
&gt; Don't we already know if we're parsing an eval?
&gt; Why do we need m_isEvalContext?
&gt; Maybe I'm mistaken.</span >

In new patch,  I've used isEvalNode template function that is deepest place where I can check EvalNode.

<span class="quote">&gt;&gt; Source/JavaScriptCore/parser/Parser.cpp:3820
&gt;&gt; +        semanticFailIfFalse(currentScope()-&gt;isFunction() || (m_isEvalContext &amp;&amp; closestParentOrdinaryFunctionNonLexicalScope()-&gt;expectedSuperBinding() == SuperBinding::Needed), &quot;super is only valid inside functions&quot;);
&gt; 
&gt; This error message should be updated.</span >

Yeah, I've created issue <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>. There is several tests that rely on this 'text', so I decided to separate this change is another patch.

<span class="quote">&gt;&gt; Source/JavaScriptCore/runtime/CodeCache.cpp:104
&gt;&gt; +    bool isEvalConext = true;
&gt; 
&gt; This is definitely not true. This should probably be a parameter to this function.</span >

Removed

<span class="quote">&gt;&gt; Source/JavaScriptCore/tests/stress/arrowfunction-lexical-bind-superproperty.js:232
&gt;&gt; +class K extends A {
&gt; 
&gt; let's have some eval tests inside a constructor.
&gt; tests for TDZ, etc.</span >

Done</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>