Commit db879f4
zhourenjian@gmail.com
Remove $t$ and $c$ if possible for those static fields
For Java code:
TestSS.bytes = new byte[10];
Early version of Java2Script compiler will generate codes as following:
($t$ = test.j2s.TestSS.bytes, test.j2s.TestSS.bytes = Clazz.newByteArray (10, 0), test.j2s.TestSS.prototype.bytes = test.j2s.TestSS.bytes, $t$);
From now on, by default, as .j2s configuration will be
j2s.compiler.static.quirks=disable
J2S compiler will generate codes as following:
test.j2s.TestSS.bytes = Clazz.newByteArray (10, 0);
Codes generated are much simpler.
To enable old quirks mode for static fields, add line:
j2s.compiler.static.quirks=enable
to .j2s file.1 parent 355a187 commit db879f4
File tree
4 files changed
+467
-186
lines changed- sources/net.sf.j2s.core/src/net/sf/j2s/core
- astvisitors
- compiler
4 files changed
+467
-186
lines changed
0 commit comments