Bug 225453 - [JSC] Wrong names set for anonymous classes from static class fields in some cases
Summary: [JSC] Wrong names set for anonymous classes from static class fields in some ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-06 06:13 PDT by Caio Lima
Modified: 2021-05-13 06:13 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caio Lima 2021-05-06 06:13:01 PDT
The following example is setting the wrong name for anonymous classes:

```
class C { static InnerClass = class { static f = this.name; } }
 
print(C.InnerClass.name); // prints “”, but should print “InnerClass”
```

The following example does it correctly:

```
class C { static InnerClass = class { static f; } }
 
print(C.InnerClass.name); // prints “InnerClass”
```

Both Firefox and Chrome are returning “InnerClass” for both examples. This example came up from a spec bug pointed out on https://github.com/tc39/ecma262/pull/1668#issuecomment-608189621.
Comment 1 Radar WebKit Bug Importer 2021-05-13 06:13:14 PDT
<rdar://problem/77963278>