gecko-dev/js/js2/java/Environment.java
1999-06-15 00:57:05 +00:00

30 lines
522 B
Java

import java.util.Hashtable;
class Environment {
JSScope scope = new JSScope("globals");
JSScope globalScope = scope;
void enterNewScope(JSScope newScope)
{
newScope.parent = scope;
scope = newScope;
}
void leaveScope()
{
scope = scope.parent;
}
String print()
{
StringBuffer result = new StringBuffer("Globals contents :\n");
result.append(scope.toString());
return result.toString();
}
JSValue resultValue;
}