Skip to content

Commit

Permalink
fix(transformer): 循环中有 if-else 时生成匿名表达式位置错误,close #2352
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Mar 5, 2019
1 parent 5e0bf68 commit b200a70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-transformer-wx/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export function generateAnonymousState (
func.body.body.unshift(buildConstVariableDeclaration(variableName, expr))
} else {
func.body.body.unshift(t.variableDeclaration('let', [t.variableDeclarator(t.identifier(variableName), t.nullLiteral())]))
consequent.node.body.unshift(t.expressionStatement(t.assignmentExpression(
consequent.node.body.push(t.expressionStatement(t.assignmentExpression(
'=',
t.identifier(variableName),
expr
Expand Down

0 comments on commit b200a70

Please sign in to comment.