aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 3b40a5d3..c5b67569 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1569,6 +1569,7 @@ merge(Compressor.prototype, {
var parent = scanner.parent(level);
if (parent instanceof AST_Array) return find_stop_value(parent, level + 1);
if (parent instanceof AST_Assign) {
+ if (may_throw(parent)) return node;
if (parent.left instanceof AST_SymbolRef) {
var name = parent.left.name;
if (lhs.name == name) return node;
@@ -1647,7 +1648,9 @@ merge(Compressor.prototype, {
if (is_last_node(node, parent)) return node;
if (in_conditional(node, parent)) return node;
if (parent instanceof AST_Array) return find_stop_unused(parent, level + 1);
- if (parent instanceof AST_Assign) return find_stop_unused(parent, level + 1);
+ if (parent instanceof AST_Assign) {
+ return may_throw(parent) ? node : find_stop_unused(parent, level + 1);
+ }
if (parent instanceof AST_Binary) return find_stop_unused(parent, level + 1);
if (parent instanceof AST_Call) return find_stop_unused(parent, level + 1);
if (parent instanceof AST_Case) return find_stop_unused(parent, level + 1);