fix corner case in conditionals (#5548)
This commit is contained in:
@@ -1428,8 +1428,10 @@ var AST_Import = DEFNODE("Import", "all default path properties quote", {
|
|||||||
},
|
},
|
||||||
_equals: function(node) {
|
_equals: function(node) {
|
||||||
return this.path == node.path
|
return this.path == node.path
|
||||||
|
&& prop_equals(this.all, node.all)
|
||||||
&& prop_equals(this.default, node.default)
|
&& prop_equals(this.default, node.default)
|
||||||
&& (this.all ? prop_equals(this.all, node.all) : all_equals(this.properties, node.properties));
|
&& !this.properties == !node.properties
|
||||||
|
&& (!this.properties || all_equals(this.properties, node.properties));
|
||||||
},
|
},
|
||||||
walk: function(visitor) {
|
walk: function(visitor) {
|
||||||
var node = this;
|
var node = this;
|
||||||
|
|||||||
@@ -193,6 +193,22 @@ forbid_merge: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
merge_tail: {
|
||||||
|
options = {
|
||||||
|
conditionals: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
if (console)
|
||||||
|
import "foo";
|
||||||
|
else
|
||||||
|
import "foo";
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
console;
|
||||||
|
import "foo";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
issue_4708_1: {
|
issue_4708_1: {
|
||||||
options = {
|
options = {
|
||||||
imports: true,
|
imports: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user