File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
test/com/google/javascript/jscomp Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -3563,6 +3563,40 @@ class Baz extends Bar {
3563
3563
""" );
3564
3564
}
3565
3565
3566
+ @ Test
3567
+ public void testClassExpressionWithInnerClassName () {
3568
+ test (
3569
+ """
3570
+ const OuterName = class InnerName {
3571
+ static sf1 = 1;
3572
+ static sf2 = InnerName.sf1;
3573
+ static sf3 = this.sf2;
3574
+
3575
+ static {
3576
+ Object.defineProperties(InnerName.prototype, {bar: {value: 1}});
3577
+ InnerName.sf2++;
3578
+ this.sf3++;
3579
+ }
3580
+ };
3581
+ """ ,
3582
+ // TODO: b/435685153 - Resolve the incorrect InnerName rewrite to OuterName.
3583
+ // Incorrectly replaces InnerName with OuterName. OuterName will not yet be defined when
3584
+ // referenced from the static field initializer and static initialization block.
3585
+ """
3586
+ const OuterName = class InnerName {
3587
+ static sf1 = 1;
3588
+ static sf2 = OuterName.sf1;
3589
+ static sf3 = this.sf2;
3590
+
3591
+ static {
3592
+ Object.defineProperties(OuterName.prototype, {bar:{value:1}});
3593
+ OuterName.sf2++;
3594
+ this.sf3++;
3595
+ }
3596
+ };
3597
+ """ );
3598
+ }
3599
+
3566
3600
@ Test
3567
3601
public void testCommaCallAliasing1 () {
3568
3602
test (
You can’t perform that action at this time.
0 commit comments