Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2021-12] Support class decorators in export declarations (#14396)
- Loading branch information
1 parent
fe00618
commit 29dff68
Showing
14 changed files
with
92 additions
and
12 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
1 change: 1 addition & 0 deletions
1
...bel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-anonymous/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 @@ | ||
export default @dec class A {} |
17 changes: 17 additions & 0 deletions
17
...el-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-anonymous/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,17 @@ | ||
var _initClass, _dec; | ||
|
||
let _A; | ||
|
||
_dec = dec | ||
|
||
class A { | ||
static { | ||
[_A, _initClass] = babelHelpers.applyDecs(this, [], [_dec]); | ||
} | ||
static { | ||
_initClass(); | ||
|
||
} | ||
} | ||
|
||
export { _A as default }; |
1 change: 1 addition & 0 deletions
1
...s/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-named/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 @@ | ||
export default @dec class {} |
17 changes: 17 additions & 0 deletions
17
.../babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/default-named/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,17 @@ | ||
var _initClass, _dec; | ||
|
||
let _default2; | ||
|
||
_dec = dec | ||
|
||
class _default { | ||
static { | ||
[_default2, _initClass] = babelHelpers.applyDecs(this, [], [_dec]); | ||
} | ||
static { | ||
_initClass(); | ||
|
||
} | ||
} | ||
|
||
export { _default2 as default }; |
3 changes: 3 additions & 0 deletions
3
...abel-plugin-proposal-decorators/test/fixtures/2021-12-exported/member-decorator/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,3 @@ | ||
export class A { | ||
@dec x; | ||
} |
9 changes: 9 additions & 0 deletions
9
...bel-plugin-proposal-decorators/test/fixtures/2021-12-exported/member-decorator/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,9 @@ | ||
var _dec, _init_x; | ||
|
||
_dec = dec | ||
export class A { | ||
static { | ||
[_init_x] = babelHelpers.applyDecs(this, [[_dec, 0, "x"]], []); | ||
} | ||
x = _init_x(this); | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/named/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 @@ | ||
export @dec class A {} |
17 changes: 17 additions & 0 deletions
17
packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/named/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,17 @@ | ||
var _initClass, _dec; | ||
|
||
let _A; | ||
|
||
_dec = dec | ||
|
||
class A { | ||
static { | ||
[_A, _initClass] = babelHelpers.applyDecs(this, [], [_dec]); | ||
} | ||
static { | ||
_initClass(); | ||
|
||
} | ||
} | ||
|
||
export { _A as A }; |
4 changes: 4 additions & 0 deletions
4
...s/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/no-decorators/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 @@ | ||
export class A {} | ||
|
||
class B {} | ||
export { B }; |
5 changes: 5 additions & 0 deletions
5
.../babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/no-decorators/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,5 @@ | ||
export class A {} | ||
|
||
class B {} | ||
|
||
export { B }; |
3 changes: 3 additions & 0 deletions
3
packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-exported/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,3 @@ | ||
{ | ||
"plugins": [["proposal-decorators", { "version": "2021-12" }]] | ||
} |
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