[Pkg-javascript-commits] [uglifyjs] 59/190: Fix parsing invalid input

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.

commit 18d37ac761d8f9bb3904d447ddbb0ac471fc161c
Author: Mihai Bazon <mihai.bazon at gmail.com>
Date:   Mon Nov 9 13:15:20 2015 +0200

    Fix parsing invalid input
    
    i.e. `x = 1.xe` — because parseFloat("1.xe") returns 1, this parsed as
    `x = 1`.
    
    Ref #857
---
 lib/parse.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/parse.js b/lib/parse.js
index 4c548a2..cb35118 100644
--- 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;
     }
 };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list