private AddNewField ( String name, Object value, FieldAttributes attributeFlags ) : |
||
name | String | |
value | Object | |
attributeFlags | FieldAttributes | |
return |
internal override JSVariableField AddNewField(String name, Object value, FieldAttributes attributeFlags){
if (!this.isComponentScope)
return base.AddNewField(name, value, attributeFlags);
//Could get here from eval
return ((GlobalScope)this.parent).AddNewField(name, value, attributeFlags);
}
public static void JScriptPackage(string rootName, VsaEngine engine) { GlobalScope globalScope = ((IActivationObject)engine.ScriptObjectStackTop()).GetGlobalScope(); if (globalScope.GetLocalField(rootName) == null) { FieldInfo info = globalScope.AddNewField(rootName, Namespace.GetNamespace(rootName, engine), FieldAttributes.Literal | FieldAttributes.Public); } }