fix various for-of bugs (#2800)
- disable `rename` pass on harmony due to problem with for-of loops fixes #2794
This commit is contained in:
@@ -766,6 +766,7 @@ function OutputStream(options) {
|
||||
|| p instanceof AST_Arrow // x => (x, x)
|
||||
|| p instanceof AST_DefaultAssign // x => (x = (0, function(){}))
|
||||
|| p instanceof AST_Expansion // [...(a, b)]
|
||||
|| p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {}
|
||||
;
|
||||
});
|
||||
|
||||
@@ -1046,11 +1047,7 @@ function OutputStream(options) {
|
||||
output.with_parens(function(){
|
||||
self.init.print(output);
|
||||
output.space();
|
||||
if (self instanceof AST_ForOf) {
|
||||
output.print("of");
|
||||
} else {
|
||||
output.print("in");
|
||||
}
|
||||
output.print(self instanceof AST_ForOf ? "of" : "in");
|
||||
output.space();
|
||||
self.object.print(output);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user