check for ending dot before pushing on another when trying to fix integer member expressions - fixes #2177
This commit is contained in:
parent
3961b720be
commit
20fa6cd8f4
@ -280,7 +280,7 @@ export function MemberExpression(node, print) {
|
||||
} else {
|
||||
if (t.isLiteral(node.object)) {
|
||||
var val = this._Literal(node.object);
|
||||
if (isInteger(+val) && !SCIENTIFIC_NOTATION.test(val)) {
|
||||
if (isInteger(+val) && !SCIENTIFIC_NOTATION.test(val) && !this.endsWith(".")) {
|
||||
this.push(".");
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,3 +6,6 @@ foo.bar["foo"];
|
||||
|
||||
foo["foo"]["bar"];
|
||||
foo[test()][bar()];
|
||||
|
||||
0..toString();
|
||||
0.5.toString();
|
||||
|
||||
@ -6,3 +6,6 @@ foo.bar["foo"];
|
||||
|
||||
foo["foo"]["bar"];
|
||||
foo[test()][bar()];
|
||||
|
||||
0..toString();
|
||||
0.5.toString();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user