|
7 | 7 |
|
8 | 8 | // Google closure compiler cannot handle Clazz.new or Clazz.super
|
9 | 9 |
|
| 10 | +// BH 2020.06.18 better test for instanceof Object[] |
10 | 11 | // BH 2020.06.03 sets user.home and user.dir to /TEMP/swingjs, and user.name to "swingjs"
|
11 | 12 | // BH 2020.04.01 2.2.0-v1e fixes missing C$.superclazz when class loaded from core
|
12 | 13 | // BH 2020.03.19 3.2.9-v1c fixes new String("xxx") !== "xxx"
|
@@ -380,10 +381,16 @@ Clazz.instanceOf = function (obj, clazz) {
|
380 | 381 | clazz.$clazz$ && (clazz = clazz.$clazz$);
|
381 | 382 | if (obj == clazz)
|
382 | 383 | return true;
|
383 |
| - if (obj.__ARRAYTYPE || clazz.__ARRAYTYPE) |
384 |
| - return (obj.__ARRAYTYPE == clazz.__ARRAYTYPE |
385 |
| - || obj.__ARRAYTYPE && clazz.__ARRAYTYPE && obj.__NDIM == clazz.__NDIM |
386 |
| - && isInstanceOf(obj.__BASECLASS, clazz.__BASECLASS)); |
| 384 | + if (obj.__ARRAYTYPE || clazz.__ARRAYTYPE) { |
| 385 | + if (obj.__ARRAYTYPE == clazz.__ARRAYTYPE) |
| 386 | + return true; |
| 387 | + if (clazz.__BASECLASS == Clazz._O) { |
| 388 | + return (!obj.__ARRAYTYPE ? Array.isArray(obj) && clazz.__NDIM == 1 |
| 389 | + : obj.__NDIM >= clazz.__NDIM && !obj.__BASECLASS.__PRIMITIVE); |
| 390 | + } |
| 391 | + return obj.__ARRAYTYPE && clazz.__ARRAYTYPE && obj.__NDIM == clazz.__NDIM |
| 392 | + && isInstanceOf(obj.__BASECLASS, clazz.__BASECLASS); |
| 393 | + } |
387 | 394 | return (obj instanceof clazz || isInstanceOf(getClassName(obj, true), clazz, true));
|
388 | 395 | };
|
389 | 396 |
|
@@ -3647,8 +3654,8 @@ var maxValueOf = 127;
|
3647 | 3654 |
|
3648 | 3655 | var getCachedNumber = function(i, a, cl, c$) {
|
3649 | 3656 | if (i >= minValueOf && i <= maxValueOf) {
|
3650 |
| - var v = a[i + minValueOf]; |
3651 |
| - return (v ? v : a[i + minValueOf] = Clazz.new_(cl[c$], [i])); |
| 3657 | + var v = a[i - minValueOf]; |
| 3658 | + return (v ? v : a[i - minValueOf] = Clazz.new_(cl[c$], [i])); |
3652 | 3659 | }
|
3653 | 3660 | }
|
3654 | 3661 |
|
|
0 commit comments