Fix invalid codegen for number member expr
This commit is contained in:
@@ -221,14 +221,8 @@ export function MemberExpression(node: Object) {
|
||||
this.print(node.property, node);
|
||||
this.push("]");
|
||||
} else {
|
||||
if (t.isLiteral(node.object) && !t.isTemplateLiteral(node.object)) {
|
||||
let val;
|
||||
if (this.format.minified) {
|
||||
val = this._stringLiteral(node.object);
|
||||
} else {
|
||||
val = this.getPossibleRaw(node.object) || this._stringLiteral(node.object);
|
||||
}
|
||||
|
||||
if (t.isNumericLiteral(node.object)) {
|
||||
let val = this.getPossibleRaw(node.object) || node.object.value;
|
||||
if (isInteger(+val) && !SCIENTIFIC_NOTATION.test(val) && !ZERO_DECIMAL_INTEGER.test(val) && !this.endsWith(".")) {
|
||||
this.push(".");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user