babel-generator: ignore if TemplateLiteral - fixes #2821

This commit is contained in:
Henry Zhu 2015-11-07 19:55:28 -05:00
parent 264c207cb9
commit 99284822f3

View File

@ -206,7 +206,7 @@ export function MemberExpression(node: Object) {
this.print(node.property, node);
this.push("]");
} else {
if (t.isLiteral(node.object)) {
if (t.isLiteral(node.object) && !t.isTemplateLiteral(node.object)) {
let val = this.getPossibleRaw(node.object) || this._stringLiteral(node.object);
if (isInteger(+val) && !SCIENTIFIC_NOTATION.test(val) && !this.endsWith(".")) {
this.push(".");