gecko-dev/js/js2/java/Environment.java

30 lines
522 B
Java
Raw Normal View History

1999-05-07 22:18:39 +00:00
import java.util.Hashtable;
class Environment {
JSScope scope = new JSScope("globals");
JSScope globalScope = scope;
1999-06-11 23:05:16 +00:00
void enterNewScope(JSScope newScope)
1999-06-11 23:05:16 +00:00
{
newScope.parent = scope;
scope = newScope;
}
void leaveScope()
{
scope = scope.parent;
1999-06-11 23:05:16 +00:00
}
1999-05-28 19:00:48 +00:00
1999-05-07 22:18:39 +00:00
String print()
{
StringBuffer result = new StringBuffer("Globals contents :\n");
result.append(scope.toString());
1999-05-07 22:18:39 +00:00
return result.toString();
}
1999-06-11 00:21:26 +00:00
JSValue resultValue;
1999-05-07 22:18:39 +00:00
}