2003/12/07 10:24:31
authordavid <david@xwt.org>
Fri, 30 Jan 2004 07:42:40 +0000 (07:42 +0000)
committerdavid <david@xwt.org>
Fri, 30 Jan 2004 07:42:40 +0000 (07:42 +0000)
darcs-hash:20040130074240-0c9ea-c6cc221b4866ccac5c5070994e276e4a62775fed.gz

src/org/xwt/js/Interpreter.java

index 101b0af..be5755b 100644 (file)
@@ -552,6 +552,9 @@ class Interpreter implements ByteCodes, Tokens {
     // Operations on Primitives //////////////////////////////////////////////////////////////////////
 
     static Object callMethodOnPrimitive(Object o, Object method, Object arg0, Object arg1, Object arg2, Object[] rest, int alength) throws JSExn {
+        if (method == null || !(method instanceof String) || "".equals(method))
+            throw new JSExn("attempt to call a non-existant method on a primitive");
+
         if (o instanceof Number) {
             //#switch(method)
             case "toFixed": throw new JSExn("toFixed() not implemented");