From 2d389423afabcaf54eb40f1d3a5da87fc8630e44 Mon Sep 17 00:00:00 2001 From: "norris%netscape.com" Date: Thu, 29 Apr 1999 20:51:50 +0000 Subject: [PATCH] Fall through to number case only after considering character and boolean independently. --- js/rhino/org/mozilla/javascript/NativeJavaObject.java | 4 ++-- js/rhino/src/org/mozilla/javascript/NativeJavaObject.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/rhino/org/mozilla/javascript/NativeJavaObject.java b/js/rhino/org/mozilla/javascript/NativeJavaObject.java index 824f9733e9e..d33ea7311dd 100644 --- a/js/rhino/org/mozilla/javascript/NativeJavaObject.java +++ b/js/rhino/org/mozilla/javascript/NativeJavaObject.java @@ -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) { diff --git a/js/rhino/src/org/mozilla/javascript/NativeJavaObject.java b/js/rhino/src/org/mozilla/javascript/NativeJavaObject.java index 824f9733e9e..d33ea7311dd 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeJavaObject.java +++ b/js/rhino/src/org/mozilla/javascript/NativeJavaObject.java @@ -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) {