Fixed bug with printing

This commit is contained in:
NeeEoo
2024-04-24 04:07:34 +02:00
parent b13d449b78
commit cd3bc5b194
2 changed files with 8 additions and 3 deletions
+6 -3
View File
@@ -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 ) {
+2
View File
@@ -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);