var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", {
$documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)",
- $propdoc: {
- init: "[AST_Node*/S] array of initializers for this declaration."
- }
}, AST_Symbol);
var AST_SymbolVar = DEFNODE("SymbolVar", null, {
AST_Node.DEFMETHOD("reset_opt_flags", function(compressor, rescan){
var reduce_vars = rescan && compressor.option("reduce_vars");
+ var ie8 = !compressor.option("screw_ie8");
var safe_ids = [];
push();
var suppressor = new TreeWalker(function(node) {
d.fixed = false;
}
});
- var tw = new TreeWalker(function(node){
+ var tw = new TreeWalker(function(node, descend){
if (!(node instanceof AST_Directive || node instanceof AST_Constant)) {
node._squeezed = false;
node._optimized = false;
d.fixed = false;
}
}
+ if (ie8 && node instanceof AST_SymbolCatch) {
+ node.definition().fixed = false;
+ }
if (node instanceof AST_VarDef) {
var d = node.name.definition();
if (d.fixed === undefined) {
pop();
return true;
}
+ if (node instanceof AST_Catch) {
+ push();
+ descend();
+ pop();
+ return true;
+ }
}
});
this.walk(tw);
}
else if (node instanceof AST_SymbolVar
|| node instanceof AST_SymbolConst) {
- var def = defun.def_variable(node);
- def.init = tw.parent().value;
+ defun.def_variable(node);
}
else if (node instanceof AST_SymbolCatch) {
scope.def_variable(node);