diff --git a/tests/self/cogen-expr.es b/tests/self/cogen-expr.es index 5e8c004a..2f64f2ae 100644 --- a/tests/self/cogen-expr.es +++ b/tests/self/cogen-expr.es @@ -212,10 +212,9 @@ } function cgUnaryExpr(ctx, e) { - let {asm:asm, emitter:emitter} = ctx; + var {asm:asm, emitter:emitter} = ctx; - let incdec = function incdec(pre, inc) { - //let name; + function incdec(pre, inc) { switch type (e.e1) { case (lr:LexicalRef) { //name = cgIdentExpr(ctx, lr.ident); diff --git a/tests/self/cogen-stmt.es b/tests/self/cogen-stmt.es index 30c917c5..20c1e6f1 100644 --- a/tests/self/cogen-stmt.es +++ b/tests/self/cogen-stmt.es @@ -165,15 +165,21 @@ } function cgBreakStmt(ctx, {ident: ident}) { + function hit (node) { + return node.tag == "break" && (ident == null || memberOf(ident, stk.labels)) + } unstructuredControlFlow(ctx, - (function (node) node.tag == "break" && (ident == null || memberOf(ident, stk.labels))), + hit, true, "Internal error: definer should have checked that all referenced labels are defined"); } function cgContinueStmt(ctx, {ident: ident}) { + function hit(node) { + return node.tag == "continue" && (ident == null || memberOf(ident, stk.labels)) + } unstructuredControlFlow(ctx, - (function (node) node.tag == "continue" && (ident == null || memberOf(ident, stk.labels))), + hit, true, "Internal error: definer should have checked that all referenced labels are defined"); } @@ -191,8 +197,11 @@ t = asm.getTemp(); asm.I_setlocal(t); } + function hit(node){ + return node.tag == "function" + } unstructuredControlFlow(ctx, - (function (node) node.tag == "function"), + hit, false, "Internal error: definer should have checked that top-level code does not return"); if (s.expr == null) diff --git a/tests/self/emitter.es b/tests/self/emitter.es index 8214b1ec..5a4d4f18 100644 --- a/tests/self/emitter.es +++ b/tests/self/emitter.es @@ -93,7 +93,8 @@ namespace Emit; } public function finalize() { - forEach(function (s) { s.finalize() }, scripts); + function f(s) { s.finalize() } + forEach(f, scripts); return file; }