From f30f2e221374a1f00696639d79b8f272c28ca4c7 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Wed, 20 May 2015 09:44:51 -0700 Subject: [PATCH] Compilation fixes --- ast/ast.ts | 4 ++++ ast/compiler.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ast/ast.ts b/ast/ast.ts index 6d3866dc..a4fd54cc 100644 --- a/ast/ast.ts +++ b/ast/ast.ts @@ -755,6 +755,10 @@ module TDev.AST { public accept(v:NodeVisitor) { return v.visitBreak(this); } public isExecutableStmt() { return true; } + private emptyExpr = Parser.emptyExpr(); + public calcNode() { return this.emptyExpr; } + public children() { return []; } + public writeTo(tw:TokenWriter) { this.writeIdOpt(tw); diff --git a/ast/compiler.ts b/ast/compiler.ts index ab256a2e..19e438b2 100644 --- a/ast/compiler.ts +++ b/ast/compiler.ts @@ -934,7 +934,7 @@ module TDev.AST if (ex != this.unit) r.push(new JsExprStmt(ex)); this.resetAnalysisInfo(); - return s + return r } private compileInlineAction(inl:InlineAction) @@ -2175,6 +2175,7 @@ module TDev.AST this.profilingScopes.push(new JsTmpDef("profilingLastCallTimeStamp", new JsLiteral("0"))); var jsNodes: JsStmt[] = this.dispatch(a.body); + jsNodes.push(a._compilerBreakLabel); if (this.needsProfiling()) jsNodes.unshift(this.profilingScopes.pop()); @@ -2190,7 +2191,6 @@ module TDev.AST jsNodes.unshift(lab0); lab0.refs.push(lab0); - jsNodes.push(a._compilerBreakLabel); var prevMax = this.maxArgsToCheck + 1; this.insertFinalLabels(jsNodes); jsNodes.forEach((n) => n.forEachExpr((e:JsExpr) => {