Skip empty decorator lists
This commit is contained in:
parent
904229a885
commit
a2bbbd99ad
@ -62,7 +62,7 @@ export default ({ types: t }: typeof babel): babel.PluginObj<State> => ({
|
||||
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<State> => ({
|
||||
key = child.key
|
||||
}
|
||||
|
||||
if (!list.length) break
|
||||
|
||||
modifiers.push(
|
||||
t.callExpression(state.__decorate(), [
|
||||
t.arrayExpression(list),
|
||||
|
Loading…
x
Reference in New Issue
Block a user