convert stragellers to unoverloaded Literal nodes

This commit is contained in:
Sebastian McKenzie 2015-09-01 04:58:44 +01:00
parent 59f71a3a09
commit 0bf747c214
2 changed files with 4 additions and 4 deletions

View File

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

View File

@ -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;
}