Merge pull request #2911 from hzoo/i-2821

babel-generator: ignore if TemplateLiteral - fixes #2821
This commit is contained in:
Sebastian McKenzie 2015-11-08 02:36:16 -08:00
commit 7b552aee4d

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(".");