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; } }
internal ParameterDeclaration(Context context, string identifier, TypeExpression type, CustomAttributeList customAttributes) { this.identifier = identifier; this.type = (type == null) ? new TypeExpression(new ConstantWrapper(Typeob.Object, context)) : type; this.context = context; ActivationObject obj2 = (ActivationObject)context.document.engine.Globals.ScopeStack.Peek(); if (obj2.name_table[this.identifier] != null) { context.HandleError(JSError.DuplicateName, this.identifier, ((obj2 is ClassScope) || obj2.fast) || (type != null)); } else { obj2.AddNewField(this.identifier, null, FieldAttributes.PrivateScope).originalContext = context; } this.customAttributes = customAttributes; }
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; } } }
internal ParameterDeclaration(Context context, String identifier, TypeExpression type, CustomAttributeList customAttributes) : base() { this.identifier = identifier; this.type = type == null ? new TypeExpression(new ConstantWrapper(Typeob.Object, context)) : type; this.context = context; ActivationObject current_scope = (ActivationObject)context.document.engine.Globals.ScopeStack.Peek(); if (current_scope.name_table[this.identifier] != null) { //Only happens if there is another parameter declarations with the same name context.HandleError(JSError.DuplicateName, this.identifier, current_scope is ClassScope || current_scope.fast || type != null); } else { JSVariableField field = current_scope.AddNewField(this.identifier, null, 0); field.originalContext = context; } this.customAttributes = customAttributes; }