This commit is contained in:
rogerl@netscape.com
1999-05-20 00:14:26 +00:00
parent 07a6670f46
commit 5eeb873cfa
8 changed files with 189 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
class JSObject extends JSValue {
JSObject(String aType, String aValue)
{
type = aType;
value = aValue;
}
String print(String indent)
{
return indent + "JSObject " + type + " : " + value + "\n";
}
void evalLHS(Environment theEnv)
{
if (type == "object") {
theEnv.theStack.push(new StackValue(value));
}
else {
System.out.println("EvalLHS on non-object");
}
}
void eval(Environment theEnv)
{
if (type.equals("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()));
}
}
String type;
String value;
}