Fall through to number case only after considering character and boolean

independently.
This commit is contained in:
norris%netscape.com 1999-04-29 20:51:50 +00:00
Родитель 8f52ec5394
Коммит 2d389423af
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -218,8 +218,6 @@ public class NativeJavaObject implements Scriptable, Wrapper {
// if to is a primitive, from must be assignableFrom
// the wrapper class.
if (to.isPrimitive()) {
if (ScriptRuntime.NumberClass.isAssignableFrom(from))
return CONVERSION_TRIVIAL;
if (to == Boolean.TYPE)
return from == ScriptRuntime.BooleanClass
? CONVERSION_TRIVIAL
@ -234,6 +232,8 @@ public class NativeJavaObject implements Scriptable, Wrapper {
}
return CONVERSION_NONE;
}
if (ScriptRuntime.NumberClass.isAssignableFrom(from))
return CONVERSION_TRIVIAL;
return CONVERSION_NONTRIVIAL;
}
if (to == ScriptRuntime.CharacterClass) {

Просмотреть файл

@ -218,8 +218,6 @@ public class NativeJavaObject implements Scriptable, Wrapper {
// if to is a primitive, from must be assignableFrom
// the wrapper class.
if (to.isPrimitive()) {
if (ScriptRuntime.NumberClass.isAssignableFrom(from))
return CONVERSION_TRIVIAL;
if (to == Boolean.TYPE)
return from == ScriptRuntime.BooleanClass
? CONVERSION_TRIVIAL
@ -234,6 +232,8 @@ public class NativeJavaObject implements Scriptable, Wrapper {
}
return CONVERSION_NONE;
}
if (ScriptRuntime.NumberClass.isAssignableFrom(from))
return CONVERSION_TRIVIAL;
return CONVERSION_NONTRIVIAL;
}
if (to == ScriptRuntime.CharacterClass) {