Skip to content

Commit

Permalink
fix(transformer): 某些情况解析 ...props 错误,close #3647
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Jul 3, 2019
1 parent 0e673ad commit 11964f8
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 @@ -659,7 +659,7 @@ export function setAncestorCondition (jsx: NodePath<t.Node>, expr: t.Expression)
Adapter.if,
Adapter.else
])
const logicalJSX = jsx.findParent(p => p.isJSXElement() && p.node.openingElement.attributes.some(a => ifAttrSet.has(a.name.name as string))) as NodePath<t.JSXElement>
const logicalJSX = jsx.findParent(p => p.isJSXElement() && p.node.openingElement.attributes.some(a => t.isIdentifier(a.name) && ifAttrSet.has(a.name.name))) as NodePath<t.JSXElement>
if (logicalJSX) {
const attr = logicalJSX.node.openingElement.attributes.find(a => ifAttrSet.has(a.name.name as string))
if (attr) {
Expand Down

1 comment on commit 11964f8

@haoxinjieFE
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

发版了吗

Please sign in to comment.