<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#c3">Comment # 3</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:sbarati@apple.com" title="Saam Barati <sbarati@apple.com>"> <span class="fn">Saam Barati</span></a>
</span></b>
<pre>Comment on <span class=""><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
> + return !(m_codeBlock->isArrowFunction() || m_codeType == EvalCode) || m_isNewTargetLoadedInArrowFunction
> ? m_newTargetRegister : emitLoadNewTargetFromArrowFunctionLexicalEnvironment();</span >
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_NEW "
title="NEW - 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 class="quote">> Source/JavaScriptCore/parser/Parser.cpp:2068
> + ConstructorKind functionConstructorKind = functionBodyType == StandardFunctionBodyBlock && !m_isEvalContext</span >
Don't we already know if we're parsing an eval?
Why do we need m_isEvalContext?
Maybe I'm mistaken.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:3820
> + semanticFailIfFalse(currentScope()->isFunction() || (m_isEvalContext && closestParentOrdinaryFunctionNonLexicalScope()->expectedSuperBinding() == SuperBinding::Needed), "super is only valid inside functions");</span >
This error message should be updated.
<span class="quote">> Source/JavaScriptCore/runtime/CodeCache.cpp:104
> + bool isEvalConext = true;</span >
This is definitely not true. This should probably be a parameter to this function.
<span class="quote">> Source/JavaScriptCore/tests/stress/arrowfunction-lexical-bind-superproperty.js:232
> +class K extends A {</span >
let's have some eval tests inside a constructor.
tests for TDZ, etc.</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>