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) {
|
for (const child of path.node.body.body) {
|
||||||
switch (child.type) {
|
switch (child.type) {
|
||||||
case "ClassProperty":
|
case "ClassProperty":
|
||||||
if (!child.decorators) continue
|
if (!child.decorators) break
|
||||||
modifiers.push(
|
modifiers.push(
|
||||||
t.callExpression(state.__decorate(), [
|
t.callExpression(state.__decorate(), [
|
||||||
t.arrayExpression(child.decorators.map(d => d.expression)),
|
t.arrayExpression(child.decorators.map(d => d.expression)),
|
||||||
@ -112,6 +112,8 @@ export default ({ types: t }: typeof babel): babel.PluginObj<State> => ({
|
|||||||
key = child.key
|
key = child.key
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!list.length) break
|
||||||
|
|
||||||
modifiers.push(
|
modifiers.push(
|
||||||
t.callExpression(state.__decorate(), [
|
t.callExpression(state.__decorate(), [
|
||||||
t.arrayExpression(list),
|
t.arrayExpression(list),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user