Example #1
0
 private OverloadsCollection(IEmitter emitter, OperatorDeclaration operatorDeclaration)
 {
     this.Emitter        = emitter;
     this.Name           = operatorDeclaration.Name;
     this.JsName         = this.Emitter.GetEntityName(operatorDeclaration);
     this.Inherit        = !operatorDeclaration.HasModifier(Modifiers.Static);
     this.Static         = operatorDeclaration.HasModifier(Modifiers.Static);
     this.Member         = this.FindMember(operatorDeclaration);
     this.TypeDefinition = this.Member.DeclaringTypeDefinition;
     this.Type           = this.Member.DeclaringType;
     this.InitMembers();
     this.Emitter.Cache.AddNode(operatorDeclaration, false, this);
 }
 private OverloadsCollection(IEmitter emitter, OperatorDeclaration operatorDeclaration)
 {
     this.Emitter        = emitter;
     this.Name           = operatorDeclaration.Name;
     this.JsName         = this.Emitter.GetEntityName(operatorDeclaration, false, true);
     this.Inherit        = !operatorDeclaration.HasModifier(Modifiers.Static);
     this.Static         = operatorDeclaration.HasModifier(Modifiers.Static);
     this.Member         = this.FindMember(operatorDeclaration);
     this.TypeDefinition = this.Member.DeclaringTypeDefinition;
     this.Type           = this.Member.DeclaringType;
     this.InitMembers();
     //this.Emitter.OverloadsCache[operatorDeclaration.GetHashCode().ToString()] = this;
 }
Example #3
0
 private OverloadsCollection(IEmitter emitter, OperatorDeclaration operatorDeclaration)
 {
     this.Emitter        = emitter;
     this.Name           = operatorDeclaration.Name;
     this.JsName         = this.Emitter.GetEntityName(operatorDeclaration, false, true);
     this.Inherit        = !operatorDeclaration.HasModifier(Modifiers.Static);
     this.Static         = operatorDeclaration.HasModifier(Modifiers.Static);
     this.Member         = this.FindMember(operatorDeclaration);
     this.TypeDefinition = this.Member.DeclaringTypeDefinition;
     this.Type           = this.Member.DeclaringType;
     this.InitMembers();
     this.Emitter.OverloadsCacheNodes[new Tuple <AstNode, bool>(operatorDeclaration, false)] = this;
 }
        public override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)
        {
            if (this.HasInline(operatorDeclaration))
            {
                return;
            }

            this.FixMethodParameters(operatorDeclaration.Parameters, operatorDeclaration.Body);

            bool isStatic = operatorDeclaration.HasModifier(Modifiers.Static);

            Dictionary <OperatorType, List <OperatorDeclaration> > dict = this.CurrentType.Operators;

            var key = operatorDeclaration.OperatorType;

            if (dict.ContainsKey(key))
            {
                dict[key].Add(operatorDeclaration);
            }
            else
            {
                dict.Add(key, new List <OperatorDeclaration>(new[] { operatorDeclaration }));
            }
        }
        public override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)
        {
            if (this.HasInline(operatorDeclaration))
            {
                return;
            }

            this.FixMethodParameters(operatorDeclaration.Parameters, operatorDeclaration.Body);

            bool isStatic = operatorDeclaration.HasModifier(Modifiers.Static);

            Dictionary<OperatorType, List<OperatorDeclaration>> dict = this.CurrentType.Operators;

            var key = operatorDeclaration.OperatorType;
            if (dict.ContainsKey(key))
            {
                dict[key].Add(operatorDeclaration);
            }
            else
            {
                dict.Add(key, new List<OperatorDeclaration>(new[] { operatorDeclaration }));
            }
        }
Example #6
0
 private OverloadsCollection(IEmitter emitter, OperatorDeclaration operatorDeclaration)
 {
     this.Emitter = emitter;
     this.Name = operatorDeclaration.Name;
     this.JsName = this.Emitter.GetEntityName(operatorDeclaration, false, true);
     this.Inherit = !operatorDeclaration.HasModifier(Modifiers.Static);
     this.Static = operatorDeclaration.HasModifier(Modifiers.Static);
     this.Member = this.FindMember(operatorDeclaration);
     this.TypeDefinition = this.Member.DeclaringTypeDefinition;
     this.Type = this.Member.DeclaringType;
     this.InitMembers();
     this.Emitter.OverloadsCache[operatorDeclaration.GetHashCode().ToString()] = this;
 }