<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 created before super() causes TDZ, should it?"
href="https://bugs.webkit.org/show_bug.cgi?id=149338#c3">Comment # 3</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:sbarati@apple.com" title="Saam Barati <sbarati@apple.com>"> <span class="fn">Saam Barati</span></a>
</span></b>
<pre>I think we can be smart and not do anything if the "this"
isn't used in the arrow function. But after speaking with Joe,
I believe it should never throw on construction. The "this"
should be under TDZ, which means it should be only dependent on
time and not location in code. So, as long as super() is invoked
before a "this" is evaluated inside the arrow function, we should
be okay. For example, this is ok:
class C {
constructor() {
let x = () => (false ? this : 20);
x();
super();
}
}</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>