From f96aa5446119a21af9fed1ac1b985853c4af5559 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sat, 3 Dec 2016 14:05:13 +0300 Subject: [PATCH] Fix attaching source maps to JS file --- tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 899cc2558..473f06bb0 100644 --- a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java +++ b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java @@ -444,8 +444,9 @@ public class TeaVMTool implements BaseTeaVMTool { if (targetType == TeaVMTargetType.JAVASCRIPT) { try (OutputStream output = new FileOutputStream(new File(targetDirectory, outputName), true)) { - Writer writer = new OutputStreamWriter(output, "UTF-8"); - additionalJavaScriptOutput(writer); + try (Writer writer = new OutputStreamWriter(output, "UTF-8")) { + additionalJavaScriptOutput(writer); + } } }