internal GlobalScope(GlobalScope parent, VsaEngine engine, bool isComponentScope)
: base(parent){
this.componentScopes = null;
this.recursive = false;
this.isComponentScope = isComponentScope;
if (parent == null){
this.globalObject = engine.Globals.globalObject;
this.globalObjectTR = TypeReflector.GetTypeReflectorFor(Globals.TypeRefs.ToReferenceContext(this.globalObject.GetType()));
this.fast = !(this.globalObject is LenientGlobalObject);
}else{
this.globalObject = null;
this.globalObjectTR = null;
this.fast = parent.fast;
if (isComponentScope)
((GlobalScope)this.parent).AddComponentScope(this);
}
this.engine = engine;
this.isKnownAtCompileTime = this.fast;
this.evilScript = true; //True by default. Set it false when a single script block is being compiled.
this.thisObject = this;
this.typeReflector = TypeReflector.GetTypeReflectorFor(Globals.TypeRefs.ToReferenceContext(this.GetType()));
if (isComponentScope)
engine.Scopes.Add(this);
}