Fall through to number case only after considering character and boolean
independently. git-svn-id: svn://10.0.0.236/trunk@29804 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user