зеркало из https://github.com/mozilla/pluotsorbet.git
checkCast should throw ClassCastException.
This commit is contained in:
Родитель
5196bfdf04
Коммит
ce7923046a
|
@ -894,19 +894,19 @@ module J2ME {
|
|||
|
||||
export function checkCast(object: java.lang.Object, klass: Klass) {
|
||||
if (object !== null && !isAssignableTo(object.klass, klass)) {
|
||||
throw new TypeError();
|
||||
throw $.ctx.createException("java/lang/ClassCastException");
|
||||
}
|
||||
}
|
||||
|
||||
export function checkCastKlass(object: java.lang.Object, klass: Klass) {
|
||||
if (object !== null && object.klass.display[klass.depth] !== klass) {
|
||||
throw new TypeError();
|
||||
throw $.ctx.createException("java/lang/ClassCastException");
|
||||
}
|
||||
}
|
||||
|
||||
export function checkCastInterface(object: java.lang.Object, klass: Klass) {
|
||||
if (object !== null && object.klass.interfaces.indexOf(klass) < 0) {
|
||||
throw new TypeError();
|
||||
throw $.ctx.createException("java/lang/ClassCastException");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче