(path, file)
| 109 | } |
| 110 | |
| 111 | function buildElementCall (path, file) { |
| 112 | path.parent.children = t.react.buildChildren(path.parent) |
| 113 | var tagExpr = convertJSXIdentifier(path.node.name, path.node) |
| 114 | var args = [] |
| 115 | |
| 116 | var tagName |
| 117 | if (t.isIdentifier(tagExpr)) { |
| 118 | tagName = tagExpr.name |
| 119 | } else if (t.isLiteral(tagExpr)) { |
| 120 | tagName = tagExpr.value |
| 121 | } |
| 122 | |
| 123 | if (t.react.isCompatTag(tagName)) { |
| 124 | args.push(t.stringLiteral(tagName)) |
| 125 | } else { |
| 126 | args.push(tagExpr) |
| 127 | } |
| 128 | |
| 129 | var attribs = path.node.attributes |
| 130 | if (attribs.length) { |
| 131 | attribs = buildOpeningElementAttributes(attribs, path) |
| 132 | args.push(attribs) |
| 133 | } |
| 134 | return t.callExpression(t.identifier('h'), args) |
| 135 | } |
| 136 | |
| 137 | function convertJSXIdentifier (node, parent) { |
| 138 | if (t.isJSXIdentifier(node)) { |
no test coverage detected
searching dependent graphs…