From 971fa9a1f395f37009116e3288eed8306b327f1b Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Fri, 24 Feb 2023 19:55:35 +0100 Subject: [PATCH] Bump versions of dependencies --- .../javascript/rendering/AstWriter.java | 26 +++++++++++++++++++ gradle/libs.versions.toml | 22 ++++++++-------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/org/teavm/backend/javascript/rendering/AstWriter.java b/core/src/main/java/org/teavm/backend/javascript/rendering/AstWriter.java index dca9f05f3..4edbe0a26 100644 --- a/core/src/main/java/org/teavm/backend/javascript/rendering/AstWriter.java +++ b/core/src/main/java/org/teavm/backend/javascript/rendering/AstWriter.java @@ -66,6 +66,7 @@ import org.mozilla.javascript.ast.SwitchStatement; import org.mozilla.javascript.ast.ThrowStatement; import org.mozilla.javascript.ast.TryStatement; import org.mozilla.javascript.ast.UnaryExpression; +import org.mozilla.javascript.ast.UpdateExpression; import org.mozilla.javascript.ast.VariableDeclaration; import org.mozilla.javascript.ast.VariableInitializer; import org.mozilla.javascript.ast.WhileLoop; @@ -294,6 +295,8 @@ public class AstWriter { printInfix((InfixExpression) node, precedence); } else if (node instanceof UnaryExpression) { printUnary((UnaryExpression) node, precedence); + } else if (node instanceof UpdateExpression) { + printUnary((UpdateExpression) node, precedence); } break; } @@ -730,6 +733,29 @@ public class AstWriter { } private void printUnary(UnaryExpression node, int precedence) throws IOException { + int innerPrecedence = PRECEDENCE_PREFIX; + + if (innerPrecedence > precedence) { + writer.append('('); + } + + String op = AstNode.operatorToString(node.getType()); + if (op.startsWith("-")) { + writer.append(' '); + } + writer.append(op); + if (requiresWhitespaces(node.getType())) { + writer.append(' '); + } + + print(node.getOperand(), innerPrecedence); + + if (innerPrecedence > precedence) { + writer.append(')'); + } + } + + private void printUnary(UpdateExpression node, int precedence) throws IOException { int innerPrecedence = node.isPostfix() ? PRECEDENCE_POSTFIX : PRECEDENCE_PREFIX; if (innerPrecedence > precedence) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a0c3efaec..ac085a8cd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,8 @@ [versions] asm = "9.4" -jackson = "2.12.2" -jetty = "9.4.38.v20210224" +jackson = "2.14.2" +jetty = "9.4.50.v20221201" shadow = "7.1.2" checkstyle = "8.41" idea = "2020.1.4" @@ -13,11 +13,11 @@ maven-tools = "3.7.1" [libraries] -hppc = "com.carrotsearch:hppc:0.8.2" -commons-io = "commons-io:commons-io:2.8.0" -commons-cli = "commons-cli:commons-cli:1.4" -rhino = "org.mozilla:rhino:1.7.11" -slf4j = "org.slf4j:slf4j-api:1.7.30" +hppc = "com.carrotsearch:hppc:0.9.1" +commons-io = "commons-io:commons-io:2.11.0" +commons-cli = "commons-cli:commons-cli:1.5.0" +rhino = "org.mozilla:rhino:1.7.14" +slf4j = "org.slf4j:slf4j-api:2.0.6" javax-servlet = "javax.servlet:javax.servlet-api:3.1.0" javax-websocket = "javax.websocket:javax.websocket-api:1.0" @@ -30,11 +30,11 @@ asm-analysis = { module = "org.ow2.asm:asm-analysis", version.ref = "asm" } jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" } jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } -gson = "com.google.code.gson:gson:2.8.6" +gson = "com.google.code.gson:gson:2.10.1" jzlib = "com.jcraft:jzlib:1.1.3" -jodaTime = "joda-time:joda-time:2.7" -htmlunit = "net.sourceforge.htmlunit:htmlunit:2.37.0" -httpclient = "org.apache.httpcomponents:httpclient:4.5.13" +jodaTime = "joda-time:joda-time:2.12.2" +htmlunit = "net.sourceforge.htmlunit:htmlunit:2.70.0" +httpclient = "org.apache.httpcomponents:httpclient:4.5.14" jetty-server = { module = "org.eclipse.jetty:jetty-server", version.ref = "jetty" } jetty-websocket-server = { module = "org.eclipse.jetty.websocket:javax-websocket-server-impl", version.ref = "jetty" }