Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement decorators as presented at
2023-01
TC39 meeting (#15405)
- Loading branch information
1 parent
2a7495f
commit eae47c9
Showing
400 changed files
with
8,881 additions
and
616 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
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
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
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
...ages/babel-generator/test/fixtures/comments/decorators-after-export-to-after/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,4 @@ | ||
{ | ||
"plugins": ["decorators"], | ||
"decoratorsBeforeExport": false | ||
} |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
packages/babel-generator/test/fixtures/comments/decorators-after-export-to-before/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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* 1 */ export /* 2 */ @dec1 /* 3 */ @dec2 | ||
/* 4 */ class /* 5 */ C /* 6 */ { /* 7 */ } /* 8 */ | ||
|
||
/* A */ export /* B */ default /* C */ @dec1 /* D */ @dec2 | ||
/* E */ class /* F */ { /* G */ } /* H */ |
5 changes: 5 additions & 0 deletions
5
...ges/babel-generator/test/fixtures/comments/decorators-after-export-to-before/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,5 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"plugins": ["decorators"], | ||
"decoratorsBeforeExport": true | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/babel-generator/test/fixtures/comments/decorators-after-export-to-before/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* 1 */@dec1 | ||
/* 3 */@dec2 | ||
/* 4 */export /* 2 */class /* 5 */C /* 6 */ {/* 7 */} /* 8 */ | ||
|
||
/* A */ | ||
@dec1 | ||
/* D */@dec2 | ||
/* E */export /* B */ | ||
default /* C */class /* F */{/* G */} /* H */ |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...ges/babel-generator/test/fixtures/comments/decorators-before-export-to-after/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,5 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"plugins": ["decorators"], | ||
"decoratorsBeforeExport": false | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/babel-generator/test/fixtures/comments/decorators-before-export-to-after/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* 1 */export /* 4 */@dec1 | ||
/* 2 */@dec2 | ||
/* 3 */class /* 5 */C /* 6 */ {/* 7 */} /* 8 */ | ||
|
||
/* A */ | ||
export | ||
/* D */ default /* E */@dec1 | ||
/* B */@dec2 | ||
/* C */class /* F */{/* G */} /* H */ |
5 changes: 5 additions & 0 deletions
5
packages/babel-generator/test/fixtures/comments/decorators-before-export-to-before/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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* 1 */ @dec1 /* 2 */ @dec2 /* 3 */ | ||
export /* 4 */ class /* 5 */ C /* 6 */ { /* 7 */ } /* 8 */ | ||
|
||
/* A */ @dec1 /* B */ @dec2 /* C */ | ||
export /* D */ default /* E */ class /* F */ { /* G */ } /* H */ |
5 changes: 5 additions & 0 deletions
5
...es/babel-generator/test/fixtures/comments/decorators-before-export-to-before/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,5 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"plugins": ["decorators"], | ||
"decoratorsBeforeExport": true | ||
} |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
packages/babel-generator/test/fixtures/decorators/export-after/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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@dec export class A {} | ||
@dec export default class {} |
4 changes: 4 additions & 0 deletions
4
packages/babel-generator/test/fixtures/decorators/export-after/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@dec | ||
export class A {} | ||
@dec | ||
export default class {} |
2 changes: 2 additions & 0 deletions
2
packages/babel-generator/test/fixtures/decorators/export-before/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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export @dec class A {} | ||
export default @dec class {} |
4 changes: 4 additions & 0 deletions
4
packages/babel-generator/test/fixtures/decorators/export-before/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export @dec | ||
class A {} | ||
export default @dec | ||
class {} |
3 changes: 1 addition & 2 deletions
3
packages/babel-generator/test/fixtures/decorators/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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"plugins": [["decorators", { "decoratorsBeforeExport": false }]], | ||
"decoratorsBeforeExport": true | ||
"plugins": ["decorators"] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.