@@ -13084,6 +13084,7 @@ J2S._getResourcePath = function(path, isJavaPath) {
1308413084
1308513085// Google closure compiler cannot handle Clazz.new or Clazz.super
1308613086
13087+ // BH 6/28/2018 7:34:58 AM fix for Array.clone not copying array in the case of objects
1308713088// BH 6/27/2018 3:11:50 PM fix for class String not indicating its name
1308813089// BH 6/25/2018 3:06:30 PM adds String.concat$S
1308913090// BH 6/25/2018 12:10:25 PM Character.toTitleCase, isTitleCase as ...UpperCase
@@ -13162,7 +13163,7 @@ Clazz._assertFunction = null;
1316213163
1316313164//////// 16 methods called from code created by the transpiler ////////
1316413165
13165- Clazz.array = function(baseClass, paramType, ndims, params) {
13166+ Clazz.array = function(baseClass, paramType, ndims, params, isClone ) {
1316613167 // int[][].class Clazz.array(Integer.TYPE, -2)
1316713168 // new int[] {3, 4, 5} Clazz.array(Integer.TYPE, -1, [3, 4, 5])
1316813169 // new int[][]{new int[] {3, 4, 5}, {new int[] {3, 4, 5}}
@@ -13271,7 +13272,7 @@ Clazz.array = function(baseClass, paramType, ndims, params) {
1327113272 break;
1327213273 }
1327313274 }
13274- return newTypedA(baseClass, params, nbits, (dofill ? ndims : -ndims));
13275+ return newTypedA(baseClass, params, nbits, (dofill ? ndims : -ndims), isClone );
1327513276}
1327613277
1327713278Clazz.assert = function(clazz, obj, tf, msg) {
@@ -13299,7 +13300,7 @@ Clazz.assert = function(clazz, obj, tf, msg) {
1329913300
1330013301Clazz.clone = function(me) {
1330113302 // BH allows @j2sNative access without super constructor
13302- return appendMap(me.__ARRAYTYPE ? Clazz.array(me.__BASECLASS, me.__ARRAYTYPE, -1, me)
13303+ return appendMap(me.__ARRAYTYPE ? Clazz.array(me.__BASECLASS, me.__ARRAYTYPE, -1, me, true )
1330313304 : new me.constructor(inheritArgs), me);
1330413305}
1330513306
@@ -13916,7 +13917,7 @@ var getParamCode = Clazz._getParamCode = function(cl) {
1391613917 return cl.__PARAMCODE || (cl.__PARAMCODE = cl.__CLASS_NAME__.replace(/java\.lang\./, "").replace(/\./g, '_'));
1391713918}
1391813919
13919- var newTypedA = function(baseClass, args, nBits, ndims) {
13920+ var newTypedA = function(baseClass, args, nBits, ndims, isClone ) {
1392013921 var dim = args[0];
1392113922 if (typeof dim == "string")
1392213923 dim = dim.charCodeAt(0); // int[] a = new int['\3'] ???
@@ -13963,7 +13964,7 @@ var newTypedA = function(baseClass, args, nBits, ndims) {
1396313964 var arr = new Float64Array(dim);
1396413965 break;
1396513966 default:
13966- var arr = (dim < 0 ? val : new Array(dim));
13967+ var arr = (isClone ? new Array(dim = val.length) : dim < 0 ? val : new Array(dim));
1396713968 nBits = 0;
1396813969 if (dim > 0 && val != null)
1396913970 for (var i = dim; --i >= 0;)
0 commit comments