Skip to content

Commit 9a4dd2e

Browse files
hansonrhansonr
authored andcommitted
3.3.1-v3 finals for nested lambda;experimental async
//BH 2021.01.14 -- 3.3.1-v3 fixes missing finals for nested () -> {...} //BH 2021.01.03 -- 3.3.1-v2 adds @j2sAsync adds async for function - experimental
1 parent 77b06c4 commit 9a4dd2e

File tree

21 files changed

+822
-262
lines changed

21 files changed

+822
-262
lines changed
10.2 KB
Binary file not shown.
610 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20210101115709
1+
20210114181553
10.2 KB
Binary file not shown.
610 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20210101115709
1+
20210114181553

sources/net.sf.j2s.core/src/net/sf/j2s/core/CorePlugin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public class CorePlugin extends Plugin {
3030
// if you change the x.x.x number, be sure to also indicate that in
3131
// j2sApplet.js and also (Bob only) update.bat, update-clean.bat
3232

33+
// BH 2021.01.14 -- 3.3.1-v3 fixes missing finals for nested () -> {...}
34+
// BH 2021.01.03 -- 3.3.1-v2 adds @j2sAsync adds async for function - experimental
3335
// BH 2002.12.31 -- 3.3.1-v1 introduces full primitive 64-bit long support.
3436
// BH 2020.12.19 -- 3.2.10-v1a adds .j2s config option j2s.config.altfileproperty
3537
// BH 2020.12.19 -- 3.2.10-v1 preliminary work for 64-bit long

sources/net.sf.j2s.core/src/net/sf/j2s/core/Java2ScriptCompiler.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ class Java2ScriptCompiler {
8484
*
8585
*/
8686
private static final String J2S_EXACT_LONG = "j2s.exact.long";
87-
private static final String J2S_EXACT_LONG_DEFAULT = "false";
87+
private static final String J2S_EXACT_LONG_DEFAULT = "true";
88+
89+
/**
90+
* allow async for Runnable.run (experimental)
91+
*
92+
*/
93+
private static final String J2S_ALLOW_ASYNC_THREAD = "j2s.async.thread";
94+
private static final String J2S_ALLOW_ASYNC_THREAD_DEFAULT = "false";
8895

8996
/**
9097
* office use only
@@ -188,6 +195,8 @@ class Java2ScriptCompiler {
188195

189196
private boolean breakOnError;
190197

198+
private boolean allowAsyncThread;
199+
191200
public boolean doBreakOnError() {
192201
return breakOnError;
193202
}
@@ -281,6 +290,9 @@ boolean initializeProject(IJavaProject project, boolean isCompilationParticipant
281290

282291
exactLong = "true".equalsIgnoreCase(getProperty(J2S_EXACT_LONG, J2S_EXACT_LONG_DEFAULT));
283292

293+
allowAsyncThread = "true".equalsIgnoreCase(getProperty(J2S_ALLOW_ASYNC_THREAD, J2S_ALLOW_ASYNC_THREAD_DEFAULT));
294+
295+
284296
// includes @j2sDebug blocks
285297
isDebugging = J2S_COMPILER_MODE_DEBUG
286298
.equalsIgnoreCase(getProperty(J2S_COMPILER_MODE, J2S_COMPILER_MODE_DEFAULT));
@@ -364,6 +376,7 @@ boolean initializeProject(IJavaProject project, boolean isCompilationParticipant
364376
Java2ScriptVisitor.setAnnotating(ignoredAnnotations);
365377
Java2ScriptVisitor.setDebugging(isDebugging);
366378
Java2ScriptVisitor.setExactLong(exactLong);
379+
Java2ScriptVisitor.setAllowAsyncThread(allowAsyncThread);
367380
Java2ScriptVisitor.setLogging(lstMethodsDeclared, htMethodsCalled, logAllCalls);
368381

369382
Java2ScriptVisitor.NameMapper.setNonQualifiedNamePackages(nonqualifiedPackages);

0 commit comments

Comments
 (0)