<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@gmail.com" title="GSkachkov <gskachkov@gmail.com>"> <span class="fn">GSkachkov</span></a>
</span></b>
<pre>Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=273142&action=diff" name="attach_273142" title="Patch">attachment 273142</a> <a href="attachment.cgi?id=273142&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=273142&action=review">https://bugs.webkit.org/attachment.cgi?id=273142&action=review</a>
<span class="quote">>> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:307
>> ? m_newTargetRegister : emitLoadNewTargetFromArrowFunctionLexicalEnvironment();
>
> This function is getting hard to read. I vote for an if statement here.
> Also, I found a bug in the logic of caching here:
> <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">>> Source/JavaScriptCore/parser/Parser.cpp:2068
>> + ConstructorKind functionConstructorKind = functionBodyType == StandardFunctionBodyBlock && !m_isEvalContext
>
> Don't we already know if we're parsing an eval?
> Why do we need m_isEvalContext?
> 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">>> Source/JavaScriptCore/parser/Parser.cpp:3820
>> + semanticFailIfFalse(currentScope()->isFunction() || (m_isEvalContext && closestParentOrdinaryFunctionNonLexicalScope()->expectedSuperBinding() == SuperBinding::Needed), "super is only valid inside functions");
>
> 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">>> Source/JavaScriptCore/runtime/CodeCache.cpp:104
>> + bool isEvalConext = true;
>
> This is definitely not true. This should probably be a parameter to this function.</span >
Removed
<span class="quote">>> Source/JavaScriptCore/tests/stress/arrowfunction-lexical-bind-superproperty.js:232
>> +class K extends A {
>
> let's have some eval tests inside a constructor.
> 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>