aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 2dc6fabb..ac66ce6a 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -6279,11 +6279,15 @@ merge(Compressor.prototype, {
function can_rename(fn, name) {
if (!fn.name) return !fn.variables.get(name);
old_def = fn.name.definition();
- if (old_def.assignments > 0) return false;
- if (old_def.name == name) return true;
+ if (old_def.orig.length > 1) {
+ old_def = null;
+ } else {
+ if (old_def.assignments > 0) return false;
+ if (old_def.name == name) return true;
+ }
if (name == "await" && is_async(fn)) return false;
if (name == "yield" && is_generator(fn)) return false;
- return all(old_def.references, function(ref) {
+ return !old_def || all(old_def.references, function(ref) {
return ref.scope.find_variable(name) === sym;
});
}