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:
11
lib/parse.js
11
lib/parse.js
@@ -335,7 +335,11 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
|
||||
if (prefix) num = prefix + num;
|
||||
var valid = parse_js_number(num);
|
||||
if (!isNaN(valid)) {
|
||||
return token("num", valid);
|
||||
var tok = token("num", valid);
|
||||
if (num.indexOf('.') >= 0) {
|
||||
tok.literal = num;
|
||||
}
|
||||
return tok;
|
||||
} else {
|
||||
parse_error("Invalid syntax: " + num);
|
||||
}
|
||||
@@ -1148,10 +1152,7 @@ function parse($TEXT, options) {
|
||||
ret = _make_symbol(AST_SymbolRef);
|
||||
break;
|
||||
case "num":
|
||||
ret = new AST_Number({ start: tok, end: tok, value: tok.value });
|
||||
var value_string = $TEXT.substring(tok.pos, tok.endpos);
|
||||
if (value_string.indexOf('.') >= 0)
|
||||
ret.value_string = value_string;
|
||||
ret = new AST_Number({ start: tok, end: tok, value: tok.value, literal: tok.literal });
|
||||
break;
|
||||
case "string":
|
||||
ret = new AST_String({
|
||||
|
||||
Reference in New Issue
Block a user