convert stragellers to unoverloaded Literal nodes
This commit is contained in:
parent
59f71a3a09
commit
0bf747c214
@ -278,11 +278,11 @@ export function buildMatchMemberExpression(match:string, allowPartial?: boolean)
|
||||
if (t.isIdentifier(node)) {
|
||||
// this part doesn't match
|
||||
if (parts[i] !== node.name) return false;
|
||||
} else if (t.isLiteral(node)) {
|
||||
} else if (t.isStringLiteral(node)) {
|
||||
// this part doesn't match
|
||||
if (parts[i] !== node.value) return false;
|
||||
} else if (t.isMemberExpression(node)) {
|
||||
if (node.computed && !t.isLiteral(node.property)) {
|
||||
if (node.computed && !t.isStringLiteral(node.property)) {
|
||||
// we can't deal with this
|
||||
return false;
|
||||
} else {
|
||||
|
||||
4
packages/babel-types/src/react.js
vendored
4
packages/babel-types/src/react.js
vendored
@ -56,7 +56,7 @@ function cleanJSXElementLiteralChild(child, args) {
|
||||
}
|
||||
}
|
||||
|
||||
if (str) args.push(t.literal(str));
|
||||
if (str) args.push(t.stringLiteral(str));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -69,7 +69,7 @@ export function buildChildren(node) {
|
||||
for (var i = 0; i < node.children.length; i++) {
|
||||
var child = node.children[i];
|
||||
|
||||
if (t.isLiteral(child) && typeof child.value === "string") {
|
||||
if (t.isStringLiteral(child)) {
|
||||
cleanJSXElementLiteralChild(child, elems);
|
||||
continue;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user