Bug 220558 - [ESNext] super accesses broken on arrow functions defined as class field
Summary: [ESNext] super accesses broken on arrow functions defined as class field
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Caio Lima
Keywords: InRadar
Depends on:
Reported: 2021-01-12 12:28 PST by Caio Lima
Modified: 2021-01-12 16:08 PST (History)
8 users (show)

See Also:

Patch (3.34 KB, patch)
2021-01-12 12:32 PST, Caio Lima
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Caio Lima 2021-01-12 12:28:29 PST
The following program is throwing TypeError, but it should run sucessfully:

class C {
    func = () => {
        super.prop = "foo";
        return this.prop;

let c = new C;
assert(c.func(), "foo");


The result we are getting is: `TypeError: undefined is not an object (evaluating 'super.prop = "foo"')`. We are missing proper `super` binding there.
Comment 1 Caio Lima 2021-01-12 12:32:23 PST
Created attachment 417480 [details]
Comment 2 Caio Lima 2021-01-12 16:02:43 PST
Comment on attachment 417480 [details]

Thanks for the quick review!
Comment 3 EWS 2021-01-12 16:06:00 PST
Committed r271420: <https://trac.webkit.org/changeset/271420>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417480 [details].
Comment 4 Radar WebKit Bug Importer 2021-01-12 16:08:18 PST