public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
63d35f8
)
Fix parsing invalid input
author
Mihai Bazon
<mihai.bazon@gmail.com>
Mon, 9 Nov 2015 11:15:20 +0000
(13:15 +0200)
committer
Mihai Bazon
<mihai.bazon@gmail.com>
Mon, 9 Nov 2015 11:15:20 +0000
(13:15 +0200)
i.e. `x = 1.xe` — because parseFloat("1.xe") returns 1, this parsed as
`x = 1`.
Ref #857
lib/parse.js
patch
|
blob
|
history
diff --git
a/lib/parse.js
b/lib/parse.js
index
4c548a2
..
cb35118
100644
(file)
--- a/
lib/parse.js
+++ b/
lib/parse.js
@@
-182,7
+182,8
@@
function parse_js_number(num) {
} else if (RE_OCT_NUMBER.test(num)) {
return parseInt(num.substr(1), 8);
} else {
- return parseFloat(num);
+ var val = parseFloat(num);
+ if (val == num) return val;
}
};