diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-04-03 23:17:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-03 23:17:47 +0800 |
commit | 48b3fe99524e1e85edd30f0a326c2f1136e150e4 (patch) | |
tree | 3f8773331d9718ee579383de08f7a56d688625b3 /lib | |
parent | a4007418683f55fec52b8085bac5e4d545b70a0e (diff) | |
download | tracifyjs-48b3fe99524e1e85edd30f0a326c2f1136e150e4.tar.gz tracifyjs-48b3fe99524e1e85edd30f0a326c2f1136e150e4.zip |
fix `mangleProperties` on identifiers (#1776)
- fix handling of "-Infinity"
- add test case for "-0"
reverts #1481
Diffstat (limited to 'lib')
-rw-r--r-- | lib/propmangle.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/propmangle.js b/lib/propmangle.js index c1e8c7e4..4e43bb63 100644 --- a/lib/propmangle.js +++ b/lib/propmangle.js @@ -47,6 +47,7 @@ function find_builtins() { // NaN will be included due to Number.NaN var a = [ "Infinity", + "-Infinity", "undefined", ]; [ Object, Array, Function, Number, @@ -153,7 +154,6 @@ function mangle_properties(ast, options) { // only function declarations after this line function can_mangle(name) { - if (!is_identifier(name)) return false; if (unmangleable.indexOf(name) >= 0) return false; if (reserved.indexOf(name) >= 0) return false; if (options.only_cache) { |