Пример #1
0
 internal override void Run()
 {
     if (!this.exposed)
     {
         // expose the named item
         if (this.isVisible)
         {
             ActivationObject obj = (ActivationObject)this.Scope.GetObject();
             this.field = obj.AddFieldOrUseExistingField(this.name, this.GetObject(), FieldAttributes.Public | FieldAttributes.Static);
         }
         if (this.exposeMembers)
         {
             this.AddNamedItemNamespace();
         }
         this.exposed = true;
     }
 }
Пример #2
0
 internal override void Compile()
 {
     // if it is a named item and it has a type push the type into the field so the compiler knows about it
     if (!this.compiled)
     {
         if (this.isVisible)
         {
             ActivationObject obj   = (ActivationObject)this.Scope.GetObject();
             JSVariableField  field = (JSVariableField)obj.AddFieldOrUseExistingField(this.name, null, FieldAttributes.Public | FieldAttributes.Static);
             Type             type  = this.engine.GetType(this.typeString);
             if (type != null)
             {
                 field.type = new TypeExpression(new ConstantWrapper(type, null));
             }
             this.field = field;
         }
     }
 }