From 0bf747c2149f1af78ee2d7c649e6a4cf730d6991 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 1 Sep 2015 04:58:44 +0100 Subject: [PATCH] convert stragellers to unoverloaded Literal nodes --- packages/babel-types/src/index.js | 4 ++-- packages/babel-types/src/react.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/babel-types/src/index.js b/packages/babel-types/src/index.js index 46597cb1f6..8e9644134a 100644 --- a/packages/babel-types/src/index.js +++ b/packages/babel-types/src/index.js @@ -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 { diff --git a/packages/babel-types/src/react.js b/packages/babel-types/src/react.js index 9b0996f530..a7a739de0b 100644 --- a/packages/babel-types/src/react.js +++ b/packages/babel-types/src/react.js @@ -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; }