Moved from stack to inline execution.
git-svn-id: svn://10.0.0.236/trunk@33132 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -21,20 +21,18 @@ class SwitchNode extends ControlNode {
|
||||
|
||||
ControlNode eval(Environment theEnv)
|
||||
{
|
||||
ControlNode n = super.eval(theEnv);
|
||||
JSValue v = theEnv.theStack.pop();
|
||||
JSValue v = expr.eval(theEnv);
|
||||
int count = caseExpr.size();
|
||||
for (int i = 0; i < count; i++) {
|
||||
ExpressionNode e = (ExpressionNode)(caseExpr.elementAt(i));
|
||||
e.eval(theEnv);
|
||||
v.eq(theEnv);
|
||||
if (theEnv.theStack.pop().toJSBoolean(theEnv).isTrue())
|
||||
JSBoolean b = v.eq(theEnv, e.eval(theEnv)).toJSBoolean(theEnv);
|
||||
if (b.isTrue())
|
||||
return (ControlNode)(caseCode.elementAt(i));
|
||||
}
|
||||
if (defaultCode != null)
|
||||
return defaultCode;
|
||||
else
|
||||
return n;
|
||||
return next;
|
||||
}
|
||||
|
||||
Vector caseExpr = new Vector();
|
||||
|
||||
Reference in New Issue
Block a user