<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#c17">Comment # 17</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:sbarati&#64;apple.com" title="Saam Barati &lt;sbarati&#64;apple.com&gt;"> <span class="fn">Saam Barati</span></a>
</span></b>
        <pre>Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=267799&amp;action=diff" name="attach_267799" title="Patch">attachment 267799</a> <a href="attachment.cgi?id=267799&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt;&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:575
&gt;&gt;&gt; +    if (SourceParseMode::ArrowFunctionMode == parseMode &amp;&amp; (functionNode-&gt;usesThis() || isDerivedClassContext() || isDerivedConstructorContext()))
&gt;&gt; 
&gt;&gt; Why are these new conditions needed?
&gt;&gt; Why do we need to load this if we're &quot;SourceParseMode::ArrowFunctionMode == parseMode &amp;&amp; (isDerivedClassContext() || isDerivedConstructorContext())&quot;?
&gt; 
&gt; Without this condition following code will raise ReferenceError 'this' is undefined so to fix this error I've added this condition.
&gt; 
&gt; var A = class A {
&gt;     constructor() {
&gt;         this.value = 'testValue';
&gt;     }
&gt;     getValue () {
&gt;         return this.value;
&gt;     }
&gt;     
&gt; };
&gt; 
&gt; var B = class B extends A {
&gt;     getParentValue() {
&gt;         var arrow  = () =&gt; super.getValue();
&gt;         return arrow();
&gt;     }
&gt; };
&gt; 
&gt; var b = new B();
&gt; b. getParentValue()</span >

Gotcha. Makes sense.

<span class="quote">&gt;&gt;&gt; Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp:195
&gt;&gt;&gt; +    EvalExecutable* eval = EvalExecutable::create(callFrame, makeSource(script), codeBlock.isStrictMode(), thisTDZMode, codeBlock.unlinkedCodeBlock()-&gt;derivedContextType(), codeBlock.unlinkedCodeBlock()-&gt;isArrowFunction(), &amp;variablesUnderTDZ);
&gt;&gt; 
&gt;&gt; have you tried this out inside the inspector to make sure it works?
&gt;&gt; I.e, pausing inside an arrow function and typing in &quot;super&quot; into the console?
&gt; 
&gt; Good question. I vent done this. I've checked and it does not work. When I typing 'super' into console it raise exception 'SyntaxError: super is only valid inside functions.' The same behavior inside of the method of class and inside of the arrow function in class method. Looks like bug in class implementation.</span >

It seems like we should just give our parser the ability to allow this behind some flag. super isn't allowed in 'eval', but it's obviously useful to have this ability inside the debugger when paused inside one of these methods/constructors.</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>