diff --git a/core/src/main/java/org/teavm/backend/javascript/JavaScriptTarget.java b/core/src/main/java/org/teavm/backend/javascript/JavaScriptTarget.java index 7348ae8a3..67f894372 100644 --- a/core/src/main/java/org/teavm/backend/javascript/JavaScriptTarget.java +++ b/core/src/main/java/org/teavm/backend/javascript/JavaScriptTarget.java @@ -233,6 +233,7 @@ public class JavaScriptTarget implements TeaVMTarget, TeaVMJavaScriptHost { } RenderingContext renderingContext = new RenderingContext(debugEmitterToUse, classes, controller.getClassLoader(), controller.getServices(), controller.getProperties(), naming); + renderingContext.setMinifying(minifying); Renderer renderer = new Renderer(sourceWriter, asyncMethods, asyncFamilyMethods, controller.getDiagnostics(), renderingContext); renderer.setProperties(controller.getProperties()); diff --git a/core/src/main/java/org/teavm/backend/javascript/rendering/StatementRenderer.java b/core/src/main/java/org/teavm/backend/javascript/rendering/StatementRenderer.java index e36ce574a..99a463a71 100644 --- a/core/src/main/java/org/teavm/backend/javascript/rendering/StatementRenderer.java +++ b/core/src/main/java/org/teavm/backend/javascript/rendering/StatementRenderer.java @@ -454,8 +454,8 @@ public class StatementRenderer implements ExprVisitor, StatementVisitor { } private String generateVariableName(int index) { - if (index == 0) { - return minifying ? "$t" : "$this"; + if (index == 0 && minifying) { + return "$t"; } if (!minifying) { diff --git a/samples/benchmark/pom.xml b/samples/benchmark/pom.xml index f1e5ceac9..1cfd27ade 100644 --- a/samples/benchmark/pom.xml +++ b/samples/benchmark/pom.xml @@ -1,8 +1,18 @@ - + 4.0.0 @@ -129,8 +139,9 @@ ${project.build.directory}/generated/js/teavm org.teavm.samples.benchmark.teavm.BenchmarkStarter SEPARATE - false + true true + FULL diff --git a/tools/cli/src/main/java/org/teavm/cli/TeaVMRunner.java b/tools/cli/src/main/java/org/teavm/cli/TeaVMRunner.java index cd8a7c161..e3c6a6f7b 100644 --- a/tools/cli/src/main/java/org/teavm/cli/TeaVMRunner.java +++ b/tools/cli/src/main/java/org/teavm/cli/TeaVMRunner.java @@ -80,11 +80,11 @@ public final class TeaVMRunner { options.addOption(OptionBuilder .withDescription("Generate debug information") .withLongOpt("debug") - .create('D')); + .create('g')); options.addOption(OptionBuilder .withDescription("Generate source maps") .withLongOpt("sourcemaps") - .create('S')); + .create('G')); options.addOption(OptionBuilder .withDescription("Incremental build") .withLongOpt("incremental") diff --git a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java index 37fbdeb91..92974f1aa 100644 --- a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java +++ b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java @@ -432,7 +432,7 @@ public class TeaVMTool implements BaseTeaVMTool { } if (targetType == TeaVMTargetType.JAVASCRIPT) { - try (OutputStream output = buildTarget.createResource(outputName)) { + try (OutputStream output = new FileOutputStream(new File(targetDirectory, outputName), true)) { Writer writer = new OutputStreamWriter(output, "UTF-8"); additionalJavaScriptOutput(writer); }