exclude mangling of special property names (#1779)
- `null` - `true` - `false` - numeric literals
This commit is contained in:
@@ -46,6 +46,9 @@
|
||||
function find_builtins() {
|
||||
// NaN will be included due to Number.NaN
|
||||
var a = [
|
||||
"null",
|
||||
"true",
|
||||
"false",
|
||||
"Infinity",
|
||||
"-Infinity",
|
||||
"undefined",
|
||||
@@ -159,7 +162,7 @@ function mangle_properties(ast, options) {
|
||||
if (options.only_cache) {
|
||||
return cache.props.has(name);
|
||||
}
|
||||
if (/^[0-9.]+$/.test(name)) return false;
|
||||
if (/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(name)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user