You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently minify-numeric-literal consistently behaves like so:
mnl("45e2")// "4500"
However, it is not always appropriate to replace the numeric literal "45e2" with "4500" in source code. See here:
45e2.toString()// OK4500.toString()// This is a syntax error4500..toString()// OK and equivalent to the first line4500.toString()// OK and equivalent to the first line4500.toString()// Syntax error
So, to avoid introducing a syntax error, mnl("45e2") should return "45e2" in this situation, rather than the usual "4500".
In general, then, minify-numeric-literal needs to accept a small amount of information about the context in which the numeric literal is going to be used before it can carry out the minification, and it should return different output depending on that context.
A full list of possible contexts in which a numeric literal may be found (as well as quite a few places where a numeric literal cannot be found) is here.
The text was updated successfully, but these errors were encountered:
Currently
minify-numeric-literal
consistently behaves like so:However, it is not always appropriate to replace the numeric literal
"45e2"
with"4500"
in source code. See here:So, to avoid introducing a syntax error,
mnl("45e2")
should return"45e2"
in this situation, rather than the usual"4500"
.In general, then,
minify-numeric-literal
needs to accept a small amount of information about the context in which the numeric literal is going to be used before it can carry out the minification, and it should return different output depending on that context.A full list of possible contexts in which a numeric literal may be found (as well as quite a few places where a numeric literal cannot be found) is here.
The text was updated successfully, but these errors were encountered: