2003/12/21 03:19:03
[org.ibex.core.git] / src / org / xwt / js / Interpreter.java
index 101b0af..6d3cdb5 100644 (file)
@@ -162,6 +162,7 @@ class Interpreter implements ByteCodes, Tokens {
                     } else if (o instanceof CallMarker) {
                         if (scope instanceof Trap.TrapScope) { // handles return component of a read trap
                             Trap.TrapScope ts = (Trap.TrapScope)scope;
+                            if (retval != null) ts.cascadeHappened = true;
                             if (!ts.cascadeHappened) {
                                 ts.cascadeHappened = true;
                                 Trap t = ts.t.next;
@@ -552,6 +553,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");