aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 263bad01..5c38e407 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1512,7 +1512,7 @@ merge(Compressor.prototype, {
return !is_lexical_definition(stat);
}) ? thing.body : [ thing ];
if (thing instanceof AST_EmptyStatement) return [];
- if (thing instanceof AST_Statement) return [ thing ];
+ if (is_statement(thing)) return [ thing ];
throw new Error("Can't convert thing to statement array");
}
@@ -3382,7 +3382,7 @@ merge(Compressor.prototype, {
return in_list ? List.skip : make_node(AST_EmptyStatement, node);
}
if (node instanceof AST_Scope) return node;
- if (!(node instanceof AST_Statement)) return node;
+ if (!is_statement(node)) return node;
}));
}
}
@@ -7504,7 +7504,7 @@ merge(Compressor.prototype, {
|| first instanceof AST_Continue && external_target(first)
|| first instanceof AST_Exit)) {
var body = [];
- if (self.init instanceof AST_Statement) {
+ if (is_statement(self.init)) {
body.push(self.init);
} else if (self.init) {
body.push(make_node(AST_SimpleStatement, self.init, {
@@ -7606,7 +7606,7 @@ merge(Compressor.prototype, {
if (!cond) {
if (compressor.option("dead_code")) {
var body = [];
- if (self.init instanceof AST_Statement) {
+ if (is_statement(self.init)) {
body.push(self.init);
} else if (self.init) {
body.push(make_node(AST_SimpleStatement, self.init, {