Skip to content

Commit

Permalink
fix(transformer): 循环的 callee 是函数也需要执行上层的条件判断,close #1725
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Jan 2, 2019
1 parent 71f605f commit 7fab2c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-transformer-wx/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export class RenderParser {
if (t.isCallExpression(ary) || isContainFunction(callExpr.get('callee').get('object'))) {
const variableName = `${LOOP_CALLEE}_${this.incrementCalleeId()}`
callExpr.getStatementParent().insertBefore(
buildConstVariableDeclaration(variableName, ary)
buildConstVariableDeclaration(variableName, setParentCondition(jsxElementPath, ary, true))
)
ary = t.identifier(variableName)
}
Expand Down

0 comments on commit 7fab2c4

Please sign in to comment.