Fix handling of "use asm" when no command line flags are passed to uglifyjs. SCOPE_IS_NEEDED is unconditionally true now. Refactored floating point literal parsing to be more in keeping with the AST class design.

This commit is contained in:
kzc
2015-10-07 13:10:53 -04:00
parent 99945fcd04
commit 4d2f7d83af
4 changed files with 14 additions and 10 deletions

View File

@@ -1158,8 +1158,10 @@ function OutputStream(options) {
output.print_string(self.getValue(), self.quote);
});
DEFPRINT(AST_Number, function(self, output){
if (self.value_string !== undefined && self.scope && self.scope.has_directive('use asm')) {
output.print(self.value_string);
if (self.literal !== undefined
&& +self.literal === self.value /* paranoid check */
&& self.scope && self.scope.has_directive('use asm')) {
output.print(self.literal);
} else {
output.print(make_num(self.getValue()));
}