case DUP: stack.push(stack.peek()); break;
case NEWSCOPE: scope = new JSScope(scope); break;
case OLDSCOPE: scope = scope.getParentScope(); break;
- case ASSERT: if (!JS.toBoolean(stack.pop())) throw je("assertion failed"); break;
+ case ASSERT: if (!JS.toBoolean(stack.pop())) throw je("xwt.assertion.failed" /*FEATURE: line number*/); break;
case BITNOT: stack.push(JS.N(~JS.toLong(stack.pop()))); break;
case BANG: stack.push(JS.B(!JS.toBoolean(stack.pop()))); break;
case NEWFUNCTION: stack.push(((JSFunction)arg).cloneWithNewParentScope(scope)); break;
} 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;
// 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");