MCPcopy
hub / github.com/vuejs/babel-plugin-transform-vue-jsx / buildElementCall

Function buildElementCall

index.js:111–135  ·  view source on GitHub ↗
(path, file)

Source from the content-addressed store, hash-verified

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)) {

Callers 1

exitFunction · 0.85

Calls 2

convertJSXIdentifierFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…