summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js47
1 files changed, 31 insertions, 16 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 0182440e..0b482b07 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -229,11 +229,15 @@ var isLowerBitm = [
];
function isLower(c) {
- var cp = ord(c);
- var idx = Math.floor(cp / 32);
- var byt = isLowerBitm[idx];
+ var cp = ord(c);
+ var idx = Math.floor(cp / 32);
+ var byt = isLowerBitm[idx];
+ if (byt)
+ {
var mask = Math.pow(2, cp - idx * 32);
return (byt & mask) != 0;
+ }
+ return false;
}
var isUpperBitm = [
@@ -440,11 +444,14 @@ var isUpperBitm = [
];
function isUpper(c) {
- var cp = ord(c);
- var idx = Math.floor(cp / 32);
- var byt = isUpperBitm[idx];
+ var cp = ord(c);
+ var idx = Math.floor(cp / 32);
+ var byt = isUpperBitm[idx];
+ if (byt) {
var mask = Math.pow(2, cp - idx * 32);
return (byt & mask) != 0;
+ }
+ return false;
}
var isAlphaBitm = [
@@ -756,11 +763,14 @@ var isAlphaBitm = [
];
function isAlpha(c) {
- var cp = ord(c);
- var idx = Math.floor(cp / 32);
- var byt = isAlphaBitm[idx];
+ var cp = ord(c);
+ var idx = Math.floor(cp / 32);
+ var byt = isAlphaBitm[idx];
+ if (byt) {
var mask = Math.pow(2, cp - idx * 32);
return (byt & mask) != 0;
+ }
+ return false;
}
var isDigitBitm = [
@@ -963,11 +973,14 @@ var isDigitBitm = [
];
function isDigit(c) {
- var cp = ord(c);
- var idx = Math.floor(cp / 32);
- var byt = isDigitBitm[idx];
+ var cp = ord(c);
+ var idx = Math.floor(cp / 32);
+ var byt = isDigitBitm[idx];
+ if (byt) {
var mask = Math.pow(2, cp - idx * 32);
return (byt & mask) != 0;
+ }
+ return false;
}
function isAlnum(c) { return isAlpha(c) || isDigit(c); }
@@ -1316,14 +1329,16 @@ var isPrintBitm = [
];
function isPrint(c) {
- var cp = ord(c);
- var idx = Math.floor(cp / 32);
- var byt = isPrintBitm[idx];
+ var cp = ord(c);
+ var idx = Math.floor(cp / 32);
+ var byt = isPrintBitm[idx];
+ if (byt) {
var mask = Math.pow(2, cp - idx * 32);
return (byt & mask) != 0;
+ }
+ return false;
}
-
function toLower(c) {
var cp = ord(c);