diff --git a/js/rhino/org/mozilla/javascript/NativeJavaMethod.java b/js/rhino/org/mozilla/javascript/NativeJavaMethod.java index 376fb6b0de2..067a7551251 100644 --- a/js/rhino/org/mozilla/javascript/NativeJavaMethod.java +++ b/js/rhino/org/mozilla/javascript/NativeJavaMethod.java @@ -145,7 +145,7 @@ public class NativeJavaMethod extends NativeFunction implements Function { // OPT: or pass it back somehow Class paramTypes[] = meth.getParameterTypes(); - // First, we kill the lawyers. Er, marshall the args. + // First, we marshall the args. for (int i = 0; i < args.length; i++) { args[i] = NativeJavaObject.coerceType(paramTypes[i], args[i]); } diff --git a/js/rhino/org/mozilla/javascript/NativeJavaObject.java b/js/rhino/org/mozilla/javascript/NativeJavaObject.java index 7c1c704d5a7..824f9733e9e 100644 --- a/js/rhino/org/mozilla/javascript/NativeJavaObject.java +++ b/js/rhino/org/mozilla/javascript/NativeJavaObject.java @@ -289,6 +289,10 @@ public class NativeJavaObject implements Scriptable, Wrapper { // String if (type == ScriptRuntime.StringClass) return ScriptRuntime.toString(value); + + // Boolean + if (type == Boolean.TYPE || type == ScriptRuntime.BooleanClass) + return new Boolean(ScriptRuntime.toBoolean(value)); if (type == Character.TYPE || type == ScriptRuntime.CharacterClass) { // Special case for converting a single char string to a character diff --git a/js/rhino/src/org/mozilla/javascript/NativeJavaMethod.java b/js/rhino/src/org/mozilla/javascript/NativeJavaMethod.java index 376fb6b0de2..067a7551251 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeJavaMethod.java +++ b/js/rhino/src/org/mozilla/javascript/NativeJavaMethod.java @@ -145,7 +145,7 @@ public class NativeJavaMethod extends NativeFunction implements Function { // OPT: or pass it back somehow Class paramTypes[] = meth.getParameterTypes(); - // First, we kill the lawyers. Er, marshall the args. + // First, we marshall the args. for (int i = 0; i < args.length; i++) { args[i] = NativeJavaObject.coerceType(paramTypes[i], args[i]); } diff --git a/js/rhino/src/org/mozilla/javascript/NativeJavaObject.java b/js/rhino/src/org/mozilla/javascript/NativeJavaObject.java index 7c1c704d5a7..824f9733e9e 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeJavaObject.java +++ b/js/rhino/src/org/mozilla/javascript/NativeJavaObject.java @@ -289,6 +289,10 @@ public class NativeJavaObject implements Scriptable, Wrapper { // String if (type == ScriptRuntime.StringClass) return ScriptRuntime.toString(value); + + // Boolean + if (type == Boolean.TYPE || type == ScriptRuntime.BooleanClass) + return new Boolean(ScriptRuntime.toBoolean(value)); if (type == Character.TYPE || type == ScriptRuntime.CharacterClass) { // Special case for converting a single char string to a character