JSValue changes, closing in on JSObject API. Began 'correct' semantic

implementation for various operators.


git-svn-id: svn://10.0.0.236/trunk@32626 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rogerl%netscape.com
1999-05-25 21:49:40 +00:00
parent 2988832256
commit 1c31755a34
14 changed files with 291 additions and 146 deletions

View File

@@ -22,6 +22,29 @@ class UnaryNode extends ExpressionNode {
return result.toString();
}
void eval(Environment theEnv)
{
child.eval(theEnv);
JSValue cV = theEnv.theStack.pop();
if (op == "+")
cV.plus(theEnv);
else
if (op == "-")
cV.minus(theEnv);
else
if (op == "~")
cV.twiddle(theEnv);
else
if (op == "!")
cV.bang(theEnv);
else
if (op == "typeof")
cV.typeof(theEnv);
else
System.out.println("missing unary op " + op);
}
String getOperator()
{
return op;