Fix errors that cause several regex tests to fail

This commit is contained in:
Alexey Andreev 2015-06-20 22:27:41 +03:00
parent 8926306f17
commit 48d2732acc
2 changed files with 4 additions and 3 deletions

View File

@ -256,7 +256,7 @@ public class TCharacter extends TObject implements TComparable<TCharacter> {
return -1;
}
int d = getNumericValue(codePoint);
return d <= radix ? d : -1;
return d < radix ? d : -1;
}
public static int getNumericValue(char ch) {
@ -293,7 +293,7 @@ public class TCharacter extends TObject implements TComparable<TCharacter> {
}
public static boolean isDigit(int codePoint) {
return getNumericValue(codePoint) >= 0;
return getType(codePoint) == DECIMAL_DIGIT_NUMBER;
}
private static int[] getDigitMapping() {

View File

@ -36,6 +36,7 @@
package org.teavm.classlib.java.util.regex;
import java.util.BitSet;
import java.util.MissingResourceException;
/**
* This class represents character classes, i.e. sets of character either
@ -871,7 +872,7 @@ abstract class TAbstractCharClass extends TSpecialToken {
return row[1];
}
}
return null;
throw new MissingResourceException("", "", name);
}
}
}