Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix super method call in private instance method calling overridden m…
…ethod (#9801) * Fix super method call in private instance method calling overridden method * Change return value in test fixtures * Update tests to verify that overridden method is not called
- Loading branch information
1 parent
ae9b25a
commit 3c11a4a
Showing
13 changed files
with
78 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
...s/babel-plugin-proposal-private-methods/test/fixtures/private-method-loose/super/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
class Base { | ||
superMethod() { | ||
return 1017; | ||
return 'good'; | ||
} | ||
} | ||
|
||
class Sub extends Base { | ||
superMethod() { | ||
return 'bad'; | ||
} | ||
|
||
#privateMethod() { | ||
return super.superMethod(); | ||
} | ||
|
||
publicMethod() { | ||
return this.#privateMethod(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
packages/babel-plugin-proposal-private-methods/test/fixtures/private-method/super/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
class Base { | ||
superMethod() { | ||
return 1017; | ||
return 'good'; | ||
} | ||
} | ||
|
||
class Sub extends Base { | ||
superMethod() { | ||
return 'bad'; | ||
} | ||
|
||
#privateMethod() { | ||
return super.superMethod(); | ||
} | ||
|
||
publicMethod() { | ||
return this.#privateMethod(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
...-plugin-proposal-private-methods/test/fixtures/private-static-method-loose/super/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
...plugin-proposal-private-methods/test/fixtures/private-static-method-loose/super/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
.../babel-plugin-proposal-private-methods/test/fixtures/private-static-method/super/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
...babel-plugin-proposal-private-methods/test/fixtures/private-static-method/super/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters