[Webkit-unassigned] [Bug 149338] New: Arrow Function before super() causes TDZ, should it?

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 17 23:57:38 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=149338

            Bug ID: 149338
           Summary: Arrow Function before super() causes TDZ, should it?
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: joepeck at webkit.org
                CC: bburg at apple.com, gskachkov at gmail.com,
                    sbarati at apple.com, utatane.tea at gmail.com

* SUMMARY
Arrow Function before super() causes TDZ, should it?

You get a non-obvious TDZ runtime ReferenceError when you create an arrow function before calling super() in a subclass.

* TEST
<script>
class Parent { }
class Subclass extends Parent {
    constructor() {
        let x = () => {}; // TDZ because of capturing "this"
        super();
    }
}
console.log(new Subclass);
</script>

* PRODUCES
[Error] ReferenceError: Cannot access uninitialized variable.
    Subclass
    (anonymous function)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150918/76ba6e0c/attachment.html>


More information about the webkit-unassigned mailing list