Describe the bug
The minify-infinity pass doesn't do anything.
To Reproduce
const infinities = [Infinity, 1/0, true/false, !0/!1, true/(true/(true/false))];
const zeroes = [1/Infinity, 1/(1/0), false/true, !1/!0, true/(true/false)];
const justone = Infinity;
alert(Infinity);
Actual Output
"use strict";var infinities=[Infinity,1/0,!0/!1,!0/!1,!0/0],zeroes=[1/Infinity,0,0,0,0],justone=Infinity;alert(Infinity);
Expected Output
"use strict";var infinities=[1/0,1/0,1/0,1/0,1/0],zeroes=[0,0,0,0,0],justone=1/0;alert(1/0);
Additional context
It returns here, and therefore doesn't do the substitution:
if (path.isLVal() && !path.parentPath.isExpressionStatement()) {
return;
}
The path.parentPath.type is "ArrayExpression", "BinaryExpression", "VariableDeclarator" and "CallExpression", respectively.
I couldn't find any documentation on what .isExpressionStatement() is actually supposed to do, so I don't know whether the bug is in minify-infinity or in babel itself.
Describe the bug
The minify-infinity pass doesn't do anything.
To Reproduce
Actual Output
Expected Output
Additional context
It returns here, and therefore doesn't do the substitution:
The
path.parentPath.typeis"ArrayExpression","BinaryExpression","VariableDeclarator"and"CallExpression", respectively.I couldn't find any documentation on what
.isExpressionStatement()is actually supposed to do, so I don't know whether the bug is in minify-infinity or in babel itself.