diff --git a/hscript/Printer.hx b/hscript/Printer.hx index f77558a..b014bf2 100644 --- a/hscript/Printer.hx +++ b/hscript/Printer.hx @@ -357,10 +357,13 @@ class Printer { expr(e); case ETry(e, v, t, ecatch): add("try"); - block(e); - add(" catch( " + v); + var wasBlock = block(e); + if( !wasBlock ) { + add("\n" + tabs); + } else add(" "); + add("catch( " + v); addType(t); - add(")"); + add(" )"); block(ecatch); case EObject(fl): if( fl.length == 0 ) { diff --git a/tests/src/tests/StringCase.hx b/tests/src/tests/StringCase.hx index 719c342..ba8f5e6 100644 --- a/tests/src/tests/StringCase.hx +++ b/tests/src/tests/StringCase.hx @@ -58,6 +58,8 @@ class StringCase extends TestCase { assertEq("s.charCodeAt(7)", s.charCodeAt(7)); assertEq("s.charCodeAt(-1)", s.charCodeAt(-1)); + headerCode = ''; + Util.runKnownBug("string.code doesnt work", () -> { assertEq('"f".code', "f".code); assertEq('"o".code', "o".code);