on master help sign in
Standardisation of pattern matching failure on stderr for node backend.

Pretty-printing.

commit467aa46764ab722e5d921b819160b3a9cbc0d10f authorGuillaume Yziquel <guillaume.hj.yziquel@gmail.com> dateMon 17 Dec 2018, 00:36 (8 years ago) parent977c1f0
1 file changed+5−1
src/IRTS/JavaScript/AST.hs+5−1
src/IRTS/JavaScript/AST.hs+5−1
@@ -202,7 +202,11 @@ jsStmt2Text (JsSwitchCase exp l d) =
202202 default2Text Nothing = ""
203203 default2Text (Just z) =
204204 T.concat ["default:\n", indent $ T.concat [jsStmt2Text z, ";\nbreak;\n"]]
205−jsStmt2Text (JsError t) = T.concat ["throw new Error( ", jsAst2Text t, ");"]
205+jsStmt2Text (JsError t) =
206+ T.concat
207+ [ "console.error(", jsAst2Text t, ");\n"
208+ , "process.exit(-1);"
209+ ]
206210jsStmt2Text (JsForever x) =
207211 T.concat ["for(;;) {\n", indent $ jsStmt2Text x, "}\n"]
208212jsStmt2Text JsContinue = "continue;"