fix if_return on AST_Defun (#2010)
Previous fiix for #1052 perturbs declaration order of functions which leads to incorrect behaviour under "use strict".
This commit is contained in:
@@ -965,15 +965,15 @@ merge(Compressor.prototype, {
|
||||
CHANGED = true;
|
||||
stat = stat.clone();
|
||||
stat.condition = stat.condition.negate(compressor);
|
||||
var funs = extract_functions_from_statement_array(ret);
|
||||
var body = as_statement_array(stat.alternative).concat(ret);
|
||||
var funs = extract_functions_from_statement_array(body);
|
||||
stat.body = make_node(AST_BlockStatement, stat, {
|
||||
body: body
|
||||
});
|
||||
stat.alternative = value ? make_node(AST_SimpleStatement, value, {
|
||||
body: value.expression
|
||||
}) : null;
|
||||
ret = funs.concat([ stat.transform(compressor) ]);
|
||||
ret = [ stat.transform(compressor) ].concat(funs);
|
||||
continue loop;
|
||||
}
|
||||
//---
|
||||
|
||||
Reference in New Issue
Block a user