fix regression in transform-flow-comments for class properties (#4623)

This commit is contained in:
Dan Harper
2016-10-01 05:56:09 +01:00
committed by Henry Zhu
parent 46339463bd
commit 0e02a18216
8 changed files with 38 additions and 1 deletions

View File

@@ -37,6 +37,12 @@ export default function ({ types: t }) {
}
},
// support for `class X { foo: string }` - #4622
ClassProperty(path) {
let { node, parent } = path;
if (!node.value) wrapInFlowComment(path, parent);
},
// support `export type a = {}` - #8 Error: You passed path.replaceWith() a falsy node
"ExportNamedDeclaration|Flow"(path) {
let { node, parent } = path;