<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><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> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Implement ES6 arrow function syntax. Arrow function specific features. Lexical bind of this"
   href="https://bugs.webkit.org/show_bug.cgi?id=144956">bug 144956</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #256242 is obsolete</td>
           <td>1
           </td>
           <td>
               &nbsp;
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Implement ES6 arrow function syntax. Arrow function specific features. Lexical bind of this"
   href="https://bugs.webkit.org/show_bug.cgi?id=144956#c43">Comment # 43</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Implement ES6 arrow function syntax. Arrow function specific features. Lexical bind of this"
   href="https://bugs.webkit.org/show_bug.cgi?id=144956">bug 144956</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=""><a href="attachment.cgi?id=256242&amp;action=diff" name="attach_256242" title="Patch">attachment 256242</a> <a href="attachment.cgi?id=256242&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt;&gt; Source/JavaScriptCore/ChangeLog:9
&gt;&gt; +        In patch were implemented the following cases cases:
&gt; 
&gt; &quot;cases cases&quot; =&gt; &quot;cases&quot;</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1809
&gt;&gt; +void BytecodeGenerator::emitNewFunctionAbstract(RegisterID* dst, FuncExprNode* func, OpcodeID opcodeID)
&gt; 
&gt; Call this function &quot;emitNewFunctionCommon&quot;
&gt; and also assert that opcodeID is what you expect.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1817
&gt;&gt;      instructions().append(index);
&gt; 
&gt; I would append thisRegister conditionally here:
&gt; if (opcodeID == op_new_arrow_func_exp)
&gt;     instruction().append(thisRegister()-&gt;index())</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1829
&gt;&gt; +    emitTDZCheck(thisRegister());
&gt; 
&gt; Do we need a TDZ check here? If so, why?</span >

See comment from Ryosuke Niwa <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Implement ES6 arrow function syntax"
   href="show_bug.cgi?id=140855#c66">https://bugs.webkit.org/show_bug.cgi?id=140855#c66</a>
Without this TDZ checks following test will fail LayoutTests/js/script-tests/arrowfunction-tdz.js

<span class="quote">&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1831
&gt;&gt; +    instructions().append(thisRegister()-&gt;index());
&gt; 
&gt; Above code change will let you remove this.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:4564
&gt;&gt; +    ? m_jit.graph().globalObjectFor(node-&gt;origin.semantic)-&gt;arrowFunctionStructure()
&gt; 
&gt; Indent four spaces (and to all below).</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/jit/JITOpcodes.cpp:986
&gt;&gt; +void JIT::emit_op_new_abstract_func_exp(Instruction* currentInstruction, FunctionType functionType)
&gt; 
&gt; Nit: I would camel case this and call it:
&gt; emitNewFuncExprCommon.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/jit/JITOperations.cpp:1024
&gt;&gt; +EncodedJSValue JIT_OPERATION operationNewArrowFunctionWithInvalidatedReallocationWatchpoint(ExecState* exec, JSScope* scope, JSCell* functionExecutable, EncodedJSValue thisValue)
&gt; 
&gt; Nit: This function and opeartionNewArrowFunction are nearly identical. There is probably an easy way
&gt; to combine them.</span >

Done

<span class="quote">&gt;&gt; Source/JavaScriptCore/runtime/JSArrowFunction.cpp:99
&gt;&gt; +    // Fixme: m_arrowFunction already removed by GC, because it created in before run JSArrowFunction::create method
&gt; 
&gt; What's happening with this?</span >

Actually I don't know. When JSArrowFunction::visitChildren is invoked the thisObject-&gt;m_arrowFunction property is already empty so it lead to error. I susspect that this property is already deleted by GC.</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>