mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 16:46:26 +00:00
30 lines
522 B
Java
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;
|
|
|
|
} |