var AST_Jump = DEFNODE("Jump", null, {
$documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"
-});
+}, AST_Statement);
var AST_Exit = DEFNODE("Exit", "value", {
$documentation: "Base class for “exits” (`return` and `throw`)",
if (this.bfinally) this.bfinally._walk(visitor);
});
}
-});
+}, AST_Statement);
// XXX: this is wrong according to ECMA-262 (12.4). the catch block
// should introduce another scope, as the argname should be visible
});
});
}
-});
+}, AST_Statement);
var AST_Var = DEFNODE("Var", null, {
$documentation: "A `var` statement"
function first_in_statement(output) {
var a = output.stack(), i = a.length, node = a[--i], p = a[--i];
while (i > 0) {
- if (p instanceof AST_Statement)
+ if (p instanceof AST_Statement && p.body === node)
return true;
if ((p instanceof AST_Seq && p.first === node ) ||
(p instanceof AST_Call && p.expression === node ) ||