add string check to literal raw retainment

This commit is contained in:
Sebastian McKenzie 2015-07-26 05:26:46 +01:00
parent d65c29b60a
commit 9c2621519a

View File

@ -145,7 +145,7 @@ export function _Literal(node) {
// when we populated raw // when we populated raw
if (node.raw != null && node.rawValue != null && val === node.rawValue) { if (node.raw != null && node.rawValue != null && val === node.rawValue) {
// https://github.com/babel/babel/issues/2078 // https://github.com/babel/babel/issues/2078
if (node.raw[0] === "'" || node.raw[0] === '"') { if (typeof val !== "string" || node.raw[0] === "'" || node.raw[0] === '"') {
return node.raw; return node.raw;
} }
} }