From 127ab175f0f3c6039a6cb66bb5582e7b9264c545 Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Mon, 23 Oct 2017 00:05:57 +0800 Subject: [PATCH] minor clean up --- lib/compress.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/compress.js b/lib/compress.js index 7c971b97..7085fcb3 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -2374,7 +2374,8 @@ merge(Compressor.prototype, { } return node; } - if (node instanceof AST_Definitions && !(tt.parent() instanceof AST_ForIn && tt.parent().init === node)) { + var parent = tt.parent(); + if (node instanceof AST_Definitions && !(parent instanceof AST_ForIn && parent.init === node)) { // place uninitialized names at the start var body = [], head = [], tail = []; // for unused names whose initialization has @@ -2466,7 +2467,7 @@ merge(Compressor.prototype, { && !((def = def.definition()).id in in_use_ids) && self.variables.get(def.name) === def) { if (node instanceof AST_Assign) { - return maintain_this_binding(tt.parent(), node, node.right.transform(tt)); + return maintain_this_binding(parent, node, node.right.transform(tt)); } return make_node(AST_Number, node, { value: 0