Hi,
I think there is a bug in the $.RangeMapClass (version 2.1.2), in the get function:
get: function (value) {
var rangelist = this.rangelist,
i, range, result;
if ((result = this.map[value]) !== undefined) {
return result;
}
if (rangelist) {
for (i = rangelist.length; i--;) {
range = rangelist[i];
if (range[0] <= value && range[1] >= value) {
return range[2];
}
}
}
return undefined;
}
In this code, if the value is null, the first range is always returned.
Comparing null to a numerical value is acceptable in javascript but probably not in this context.
A check for null / undefined here: if (rangelist) ... would solve this problem.
Hi, I think there is a bug in the $.RangeMapClass (version 2.1.2), in the get function:
get: function (value) { var rangelist = this.rangelist, i, range, result; if ((result = this.map[value]) !== undefined) { return result; } if (rangelist) { for (i = rangelist.length; i--;) { range = rangelist[i]; if (range[0] <= value && range[1] >= value) { return range[2]; } } } return undefined; }
In this code, if the value is null, the first range is always returned.
Comparing null to a numerical value is acceptable in javascript but probably not in this context.
A check for null / undefined here: if (rangelist) ... would solve this problem.
Regards, Patrick