Skip to content

Commit bbf712c

Browse files
committed
j2sClazz.js update
- Better startProfilin()/getProfile() - a64,a32,i32,i64 had no var due to earlier debugging - Adds Character.isValidCodePoint(int)
1 parent d581c66 commit bbf712c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Clazz.array = function(baseClass, paramType, ndims, params, isClone) {
9595

9696
var ret = _array.apply(null, arguments);
9797

98-
_profileNew && addProfileNew(baseClass, t0 - window.performance.now() - 0.01);
98+
_profileNew && addProfileNew(baseClass == -1 ? paramType.__BASECLASS : baseClass, -1);
9999

100100
return ret;
101101
}
@@ -1120,8 +1120,10 @@ Clazz.getProfile = function() {
11201120

11211121
var addProfileNew = function(c, t) {
11221122
var s = c.__CLASS_NAME__ || c.__PARAMCODE;
1123-
if (t < 0)
1123+
if (t < 0) {
11241124
s += "[]";
1125+
t = 0;
1126+
}
11251127
var p = _profileNew[s];
11261128
p || (p = _profileNew[s] = [0,0]);
11271129
p[0]++;
@@ -3342,8 +3344,7 @@ Math.signum||(Math.signum=function(d){return(d==0.0||isNaN(d))?d:d < 0 ? -1 : 1}
33423344

33433345
Math.scalb||(Math.scalb=function(d,scaleFactor){return d*Math.pow(2,scaleFactor)});
33443346

3345-
//var
3346-
a64 = null, a32 = null, i32 = null, i64 = null;
3347+
var a64 = null, a32 = null, i32 = null, i64 = null;
33473348

33483349
Math.nextAfter||
33493350
(Math.nextAfter=function(start,direction){
@@ -4902,6 +4903,15 @@ m$(C$,"charCodeAt$I",
49024903
function(i){
49034904
return(this.value).charCodeAt(i);
49044905
});
4906+
m$(C$,"isValidCodePoint$I",
4907+
function(i){
4908+
try {
4909+
String.fromCodePoint(i);
4910+
return true;
4911+
} catch(e) {
4912+
return false;
4913+
}
4914+
});
49054915

49064916
m$(C$,["compareTo$C","compareTo$","compareTo$O"],
49074917
function(c){

0 commit comments

Comments
 (0)