Latest changes

git-svn-id: svn://10.0.0.236/trunk@30777 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rogerl%netscape.com
1999-05-07 22:07:22 +00:00
parent 8455e35b97
commit b307b926e7
8 changed files with 165 additions and 52 deletions

View File

@@ -10,6 +10,37 @@ class JSValue extends ExpressionNode {
{
return indent + "JSValue " + type + " : " + value + "\n";
}
void evalLHS(Environment theEnv)
{
if (type == "object") {
// if (!theEnv.theGlobals.containsKey(value))
// theEnv.theGlobals.put(value, new Double(0.0));
theEnv.theStack.push(new StackValue(value));
}
else {
System.out.println("EvalLHS on non-object");
}
}
void eval(Environment theEnv)
{
if (type == "object") {
Double d = (Double)(theEnv.theGlobals.get(value));
if (d == null) {
System.out.println("Accessed undefined : " + value);
theEnv.theStack.push(new StackValue(0.0));
}
else
theEnv.theStack.push(new StackValue(d.doubleValue()));
}
else {
if (type == "number") {
Double d = new Double(value);
theEnv.theStack.push(new StackValue(d.doubleValue()));
}
}
}
String type;
String value;