Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: register inserted class declaration (#10302)
* Decorators legacy: register inserted declaration For compatibility with the Typescript plugin Fixes #10264 * Register declaration but also keep replaceWithMultiple
- Loading branch information
1 parent
5fb4d84
commit ba2c0f7
Showing
4 changed files
with
22 additions
and
1 deletion.
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
4 changes: 4 additions & 0 deletions
4
packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/input.mjs
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function myDecorator(decoratee) {} | ||
|
||
@myDecorator | ||
export default class {} |
6 changes: 6 additions & 0 deletions
6
packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/options.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"plugins": [ | ||
"transform-typescript", | ||
[ "proposal-decorators", { "legacy": true } ] | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/output.mjs
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var _class2; | ||
|
||
function myDecorator(decoratee) {} | ||
|
||
let _class = myDecorator(_class2 = class {}) || _class2; | ||
|
||
export { _class as default }; |