Problem related to the sourceMap option. Set the tests to use the
sourceMap option because more fragile (ideally we should test both but
tests would be twice longer)
This commit is contained in:
Renaud Pawlak 2016-07-03 09:29:59 +02:00
parent ca9dfef10e
commit 16ba6762ea
2 changed files with 5 additions and 1 deletions

View File

@ -848,7 +848,7 @@ public class Java2TypeScriptTranslator extends AbstractTreePrinter {
}
continue;
}
if (def instanceof JCVariableDecl) {
if (def instanceof JCVariableDecl && !(getScope().sharedMode && ((JCVariableDecl) def).getModifiers().getFlags().contains(Modifier.STATIC))) {
if (getScope().enumScope) {
print(", ");
} else {
@ -966,6 +966,9 @@ public class Java2TypeScriptTranslator extends AbstractTreePrinter {
println().println().printIndent().print("export namespace ").print(classdecl.getSimpleName().toString()).print(" {").startIndent();
}
println().println().printIndent().print(def);
if (def instanceof JCVariableDecl) {
print(";");
}
}
}
if (nameSpace) {

View File

@ -100,6 +100,7 @@ public class AbstractTest {
transpiler = new JSweetTranspiler(outDir, null, new File(JSweetTranspiler.TMP_WORKING_DIR_NAME + "/candies/js"),
System.getProperty("java.class.path"));
transpiler.setModuleKind(ModuleKind.none);
transpiler.setPreserveSourceLineNumbers(true);
FileUtils.deleteQuietly(transpiler.getWorkingDirectory());
transpiler.getCandiesProcessor().touch();
testSuiteInitialized = true;