Skip to content

Commit 096db21

Browse files
committed
updated j2sClazz.js, swingjs2.js
// BH 5/19/2018 8:22:25 PM fix for new int[] {'a'}
1 parent d4c296e commit 096db21

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
50.4 KB
Binary file not shown.

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

Lines changed: 9 additions & 3 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 5/19/2018 8:22:25 PM fix for new int[] {'a'}
1309513096
// BH 4/16/2018 6:14:10 PM msie flag in monitor
1309613097
// BH 2/22/2018 12:34:07 AM array.clone() fix
1309713098
// BH 2/20/2018 12:59:28 AM adds Character.isISOControl
@@ -13938,10 +13939,14 @@ var newTypedA = function(baseClass, args, nBits, ndims) {
1393813939
// Clazz.newA(5 ,null, "SA") new String[5] val = null
1393913940
// Clazz.newA(-1, ["A","B"], "SA") new String[] val = {"A", "B"}
1394013941
// Clazz.newA(3, 5, 0, "IAA") new int[3][5] (second pass, so now args = [5, 0, "IA"])
13941-
if (val == null)
13942+
if (val == null) {
1394213943
nBits = 0;
13943-
else if (nBits > 0 && dim < 0)
13944+
} else if (nBits > 0 && dim < 0) {
13945+
// make sure this is not a character
13946+
for (var i = val.length; --i >= 0;)
13947+
val[i].charAt && (val[i] = val[i].charAt(0));
1394413948
dim = val; // because we can initialize an array using new Int32Array([...])
13949+
}
1394513950
if (nBits > 0)
1394613951
ndims = 1;
1394713952
var atype;
@@ -18114,7 +18119,7 @@ Clazz.cloneFinals = function () {
1811418119
// SwingJSApplet.js
1811518120

1811618121
// generic SwingJS Applet
18117-
18122+
// BH 3/14/2018 8:42:33 PM adds applet._window for JSObject
1811818123
// BH 12/18/2016 8:09:56 AM added SwingJS.Loaded and SwingJS.isLoaded
1811918124
// BH 7/24/2015 9:09:39 AM allows setting Info.resourcePath
1812018125
// BH 4/28/2015 10:15:32 PM adds getAppletHtml
@@ -18150,6 +18155,7 @@ if (typeof(SwingJS) == "undefined") {
1815018155
this._appletType = "SwingJS._Applet" + (Info.isSigned ? " (signed)" : "");
1815118156
this._isJava = true;
1815218157
this._availableParams = null; // all allowed
18158+
this._window = window;
1815318159
if (checkOnly)
1815418160
return this;
1815518161
this._isSigned = Info.isSigned;

0 commit comments

Comments
 (0)