Skip to content

Commit fca9228

Browse files
authored
Merge pull request #41 from BobHanson/master
a[pt++] |= .... fix
2 parents 1846220 + 930aae3 commit fca9228

File tree

6 files changed

+21
-17
lines changed

6 files changed

+21
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ sources/net.sf.j2s.lib/j2slib
44
/.project
55
docs/_site
66
.jekyll-metadata
7+
12 Bytes
Binary file not shown.
12 Bytes
Binary file not shown.

sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/Java2ScriptVisitor.java

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ public boolean visit(Assignment node) {
21852185
}
21862186

21872187
/**
2188-
* We must fix
2188+
* We must fix
21892189
*
21902190
* this.ctype[low++] = (this.ctype[low++]|(4)|0);
21912191
*
@@ -2201,22 +2201,25 @@ public boolean visit(Assignment node) {
22012201
* @return
22022202
*/
22032203
private boolean fixAssignArray(int ptArray, int ptArray2, boolean wasArray) {
2204-
2204+
22052205
if (ptArray >= 0) {
2206-
trailingBuffer.addType("j");
2207-
String left = buffer.substring(ptArray, ptArray2); // zzz[xxx]
2208-
String right = buffer.substring(ptArray2);
2209-
buffer.setLength(ptArray);
2206+
String left = buffer.substring(ptArray, ptArray2); // zzz[xxx]
22102207
int ptIndex = left.indexOf("[") + 1;
2211-
String left0 = left.substring(0, ptIndex);
2212-
buffer.append(left0);
2213-
buffer.append("$j$=");
2214-
buffer.append(left.substring(ptIndex));
2215-
ptIndex = right.indexOf(left);
2216-
buffer.append(right.substring(0, ptIndex));
2217-
buffer.append(left0);
2218-
buffer.append("$j$]");
2219-
buffer.append(right.substring(ptIndex + left.length()));
2208+
if (left.length() - ptIndex >= 4) {
2209+
// at least as long as zzz[i++]
2210+
String right = buffer.substring(ptArray2);
2211+
trailingBuffer.addType("j");
2212+
buffer.setLength(ptArray);
2213+
String left0 = left.substring(0, ptIndex);
2214+
buffer.append(left0);
2215+
buffer.append("$j$=");
2216+
buffer.append(left.substring(ptIndex));
2217+
ptIndex = right.indexOf(left);
2218+
buffer.append(right.substring(0, ptIndex));
2219+
buffer.append(left0);
2220+
buffer.append("$j$]");
2221+
buffer.append(right.substring(ptIndex + left.length()));
2222+
}
22202223
isArray = wasArray;
22212224
}
22222225
return false;
-9.07 KB
Binary file not shown.

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13092,6 +13092,7 @@ J2S._getResourcePath = function(path, isJavaPath) {
1309213092

1309313093
// Google closure compiler cannot handle Clazz.new or Clazz.super
1309413094

13095+
// BH 4/16/2018 6:14:10 PM msie flag in monitor
1309513096
// BH 2/22/2018 12:34:07 AM array.clone() fix
1309613097
// BH 2/20/2018 12:59:28 AM adds Character.isISOControl
1309713098
// BH 2/13/2018 6:24:44 AM adds String.copyValueOf (two forms)
@@ -15321,8 +15322,7 @@ var setAlpha = function (alpha) {
1532115322
fadeOutTimer = null;
1532215323
}
1532315324
fadeAlpha = alpha;
15324-
var ua = navigator.userAgent.toLowerCase();
15325-
monitorEl.style.filter = "Alpha(Opacity=" + alpha + ")";
15325+
//monitorEl.style.filter = "Alpha(Opacity=" + alpha + ")";
1532615326
monitorEl.style.opacity = alpha / 100.0;
1532715327
};
1532815328
/* private */

0 commit comments

Comments
 (0)