diff --git a/src/index.ts b/src/index.ts index 6c29a8d..7510b2c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -62,7 +62,7 @@ export default ({ types: t }: typeof babel): babel.PluginObj => ({ for (const child of path.node.body.body) { switch (child.type) { case "ClassProperty": - if (!child.decorators) continue + if (!child.decorators) break modifiers.push( t.callExpression(state.__decorate(), [ t.arrayExpression(child.decorators.map(d => d.expression)), @@ -112,6 +112,8 @@ export default ({ types: t }: typeof babel): babel.PluginObj => ({ key = child.key } + if (!list.length) break + modifiers.push( t.callExpression(state.__decorate(), [ t.arrayExpression(list),