<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:fpizlo&#64;apple.com" title="Filip Pizlo &lt;fpizlo&#64;apple.com&gt;"> <span class="fn">Filip Pizlo</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Arrow function created before super() causes TDZ, should it?"
   href="https://bugs.webkit.org/show_bug.cgi?id=149338">bug 149338</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;">CC</td>
           <td>
               &nbsp;
           </td>
           <td>fpizlo&#64;apple.com
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Arrow function created before super() causes TDZ, should it?"
   href="https://bugs.webkit.org/show_bug.cgi?id=149338#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Arrow function created before super() causes TDZ, should it?"
   href="https://bugs.webkit.org/show_bug.cgi?id=149338">bug 149338</a>
              from <span class="vcard"><a class="email" href="mailto:fpizlo&#64;apple.com" title="Filip Pizlo &lt;fpizlo&#64;apple.com&gt;"> <span class="fn">Filip Pizlo</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=149338#c3">comment #3</a>)
<span class="quote">&gt; I think we can be smart and not do anything if the &quot;this&quot;
&gt; isn't used in the arrow function. But after speaking with Joe, 
&gt; I believe it should never throw on construction. The &quot;this&quot;
&gt; should be under TDZ, which means it should be only dependent on
&gt; time and not location in code. So, as long as super() is invoked
&gt; before a &quot;this&quot; is evaluated inside the arrow function, we should
&gt; be okay. For example, this is ok:
&gt; 
&gt; class C {
&gt;     constructor() {
&gt;         let x = () =&gt; (false ? this : 20);
&gt;         x();
&gt;         super();
&gt;     }
&gt; }</span >

And also things like this should work:

class C {
    constructor() {
        let p = false;
        let x = () =&gt; (p ? this : 20);
        x(); // returns 20
        super();
        p = true;
        x(); // returns 'this'
    }
}

This should return without throwing.</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>