Пример #1
0
        public ASMethod GetMethod(int paramCount, string qualifiedName)
        {
            ASMethod method = GetMethod(qualifiedName);

            if (method?.Parameters.Count != paramCount)
            {
                return(null);
            }

            return(method);
        }
Пример #2
0
        public ASMethod GetMethod(int paramCount, string qualifiedName, string returnTypeName)
        {
            ASMethod method = GetMethod(paramCount, qualifiedName);

            if (method?.ReturnType?.Name != returnTypeName)
            {
                return(null);
            }

            return(method);
        }
Пример #3
0
        public void AddMethod(ASMethod method, string qualifiedName)
        {
            var qname = new ASMultiname(ABC.Pool);

            qname.NameIndex      = ABC.Pool.AddConstant(qualifiedName);
            qname.Kind           = MultinameKind.QName;
            qname.NamespaceIndex = 1; // Public

            int methodIndex = ABC.AddMethod(method);
            int qnameIndex  = ABC.Pool.AddConstant(qname);

            var trait = new ASTrait(ABC);

            trait.Kind        = TraitKind.Method;
            trait.QNameIndex  = qnameIndex;
            trait.MethodIndex = methodIndex;

            method.Trait     = trait;
            method.Container = this;
            Traits.Add(trait);
        }
Пример #4
0
 public ASParameter(ABCFile abc, ASMethod method)
     : base(abc)
 {
     _method = method;
 }
Пример #5
0
 public int AddMethod(ASMethod method, bool recycle = true)
 {
     return(AddValue(Methods, method, recycle));
 }