Skip to content

Commit

Permalink
Fix @babel/generator does not print decorators of private properties (
Browse files Browse the repository at this point in the history
  • Loading branch information
zweimach committed Sep 25, 2020
1 parent 6d87f46 commit af612db
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/babel-generator/src/generators/classes.js
Expand Up @@ -101,6 +101,7 @@ export function ClassProperty(node: Object) {
}

export function ClassPrivateProperty(node: Object) {
this.printJoin(node.decorators, node);
if (node.static) {
this.word("static");
this.space();
Expand Down
@@ -0,0 +1,7 @@
class A {
@dec
foo;

@dec
#bar;
}
@@ -0,0 +1,9 @@
{
"plugins": [
["decorators", { "decoratorsBeforeExport": false }],
"classProperties",
"classPrivateProperties",
"classPrivateMethods"
],
"decoratorsBeforeExport": true
}
@@ -0,0 +1,6 @@
class A {
@dec
foo;
@dec
#bar;
}

0 comments on commit af612db

Please sign in to comment.