<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. Using 'super' in arrow function that declared out of the class should lead to Syntax error"
href="https://bugs.webkit.org/show_bug.cgi?id=150893#c10">Comment # 10</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES6] Arrow function syntax. Using 'super' in arrow function that declared out of the class should lead to Syntax error"
href="https://bugs.webkit.org/show_bug.cgi?id=150893">bug 150893</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=270654&action=diff" name="attach_270654" title="Patch">attachment 270654</a> <a href="attachment.cgi?id=270654&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=270654&action=review">https://bugs.webkit.org/attachment.cgi?id=270654&action=review</a>
<span class="quote">>> Source/JavaScriptCore/ChangeLog:20
>> + Invoking super()/super in two or more evals will be part of the issue <a class="bz_bug_link
bz_status_NEW "
title="NEW - Invoking super()/super inside of the double eval should not lead to SyntaxError"
href="show_bug.cgi?id=153864">https://bugs.webkit.org/show_bug.cgi?id=153864</a>
>
> what kind of error should this be if it's not a SyntaxError?</span >
I've made small change in this sentence in the last patch.
It should be SyntaxError, but my patch only partly resolve this issue. I had to fix case with 'eval("super")' because some of the arrow function tests invoke eval('super'). During the additional testing I found out that my current patch does not cover case when we call eval('eval('super()')'), but I decided that it should not be part of this patch and created the issue
<span class="quote">>> Source/JavaScriptCore/bytecode/EvalCodeCache.h:70
>> + : derivedContextType;
>
> style: make this one line or add "{}" to the else statement.</span >
Done
<span class="quote">>> Source/JavaScriptCore/bytecode/ExecutableInfo.h:67
>> + DerivedContextType wrappedCodeBlocContextType() const { return static_cast<DerivedContextType>(m_wrappedCodeBlocContextType); }
>
> typo:
> wrappedCodeBlocContextType => wrappedCodeBlockContextType</span >
Done
<span class="quote">>> Source/JavaScriptCore/parser/Parser.cpp:2070
>> + if (!m_lexer->isReparsingFunction()) {
>
> Is this needed or just an optimization?</span >
I added comment in the last patch, I hope that now it is more clear:
// It unncecessary to check of using super during reparsing one more time. Also it can lead to syntax error
// in case of arrow function becuase during reparsing we don't know that parse arrow function
// inside of the constructor or method
<span class="quote">>> Source/JavaScriptCore/parser/Parser.h:881
>> + // Find the closest not 'arrow function' function scope.
>
> comment not needed.</span >
Removed
<span class="quote">>> Source/JavaScriptCore/tests/stress/arrowfunction-lexical-bind-superproperty.js:-131
>> - }
>
> you could keep this if you turned this into an "return eval(blah)"</span >
I've moved this test case to the LayoutTests/js/script-tests/arrowfunction-syntax-errors.js where I'm trying to collect all case that are related to the syntax errors.
See last case in 66 line in this file.</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>