<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. Arrow function specific features. Lexical bind &quot;super&quot; property"
   href="https://bugs.webkit.org/show_bug.cgi?id=149615#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Arrow function syntax. Arrow function specific features. Lexical bind &quot;super&quot; property"
   href="https://bugs.webkit.org/show_bug.cgi?id=149615">bug 149615</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=267103&amp;action=diff" name="attach_267103" title="Patch">attachment 267103</a> <a href="attachment.cgi?id=267103&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt;&gt; Source/JavaScriptCore/ChangeLog:9
&gt;&gt; +        inside of the arrow function in case if arrow function is nested in method, 
&gt; 
&gt; Might be worth explicitly adding constructor to this list of available contexts inside a class.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/ChangeLog:11
&gt;&gt; +        class, lead to wrong type of error, should be SyntaxError and this will be fixed in separete patch.
&gt; 
&gt; Do you have a bug open for this? If you don't, you should make one.
&gt; You should link to it here</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecode/ExecutableInfo.h:39
&gt;&gt; +    ExecutableInfo(bool needsActivation, bool usesEval, bool isStrictMode, bool isConstructor, bool isBuiltinFunction, ConstructorKind constructorKind, GeneratorThisMode generatorThisMode, SuperBinding superBinding, SourceParseMode parseMode, DerivedContextType _derivedContextType, bool _isArrowFunctionContext, bool isClassContext)
&gt; 
&gt; style: Remove the &quot;_&quot; prefixes.</span >

Removed

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp:70
&gt;&gt; +    bool isClassContext = executable-&gt;parseMode() == SourceParseMode::MethodMode || executable-&gt;parseMode() == SourceParseMode::GetterMode || executable-&gt;parseMode() == SourceParseMode::SetterMode;
&gt; 
&gt; Is this always correct?
&gt; We could have code like this:
&gt; ```
&gt; let x = {
&gt;     get y() { return 20; }
&gt; };
&gt; x.y
&gt; ```
&gt; I'm not sure if this would count as SourceParseMode::GetterMode.</span >

Changed. Now I'm rely on executable-&gt;superBinding() property that has value SuperBinding::Needed when it part of the class

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:578
&gt;&gt; +
&gt; 
&gt; style: revert newline.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:799
&gt;&gt; +            bool newisDerivedConstructorContext = constructorKind() == ConstructorKind::Derived || (derivedContextType() == DerivedContextType::DerivedConstructorContext &amp;&amp; metadata-&gt;parseMode() == SourceParseMode::ArrowFunctionMode);
&gt; 
&gt; This calculation doesn't seem right to me. Shouldn't we be interested in the fact that we're creating an arrow function or not?</span >

Added additional condition

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:189
&gt;&gt; +
&gt; 
&gt; style: revert newline.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/tests/stress/arrowfunction-lexical-bind-superproperty.js:1
&gt;&gt; +var testCase = function (actual, expected, message) {
&gt; 
&gt; Style: 4-space indent this file.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/tests/stress/arrowfunction-lexical-bind-superproperty.js:158
&gt;&gt; +// Fixme: should by check if e instanceof SyntaxError <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="show_bug.cgi?id=150893">https://bugs.webkit.org/show_bug.cgi?id=150893</a>
&gt; 
&gt; Style: &quot;Fixme&quot; =&gt; &quot;FIXME&quot; and also indented properly.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/tests/stress/arrowfunction-lexical-bind-superproperty.js:215
&gt;&gt; +//  testCase(j2._value, testValue, 'Error: Some problem with using &quot;super&quot; inside of the constructor');
&gt; 
&gt; Style: Indent this comment and all others to be at the level of block they're in.</span >

Done

<span class="quote">&gt;&gt; LayoutTests/js/script-tests/arrowfunction-superproperty.js:1
&gt;&gt; +description('Tests for ES6 arrow function, access to the super property in arrow function');
&gt; 
&gt; Style: 4-space indent this file.</span >

Done

<span class="quote">&gt;&gt; LayoutTests/js/script-tests/arrowfunction-superproperty.js:80
&gt;&gt; +//shouldThrow('(new C(false))', 'ReferenceError');
&gt; 
&gt; This should be &quot;new C(true)&quot;</span >

Yes, fixed</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>