コード例 #1
0
        void DefinePrototype(AvmTypeCode type, AbcMethod sig)
        {
            var srcmethod = sig.Method;

            if (srcmethod == null)
            {
                return;
            }

            string key = GetKey(type, srcmethod.Name);
            var    val = _prototypes[key] as object[];

            if (val == null)
            {
                return;
            }

            var m = val[1] as AbcMethod;

            if (m != null)
            {
                return;
            }

            var coder = val[0] as AbcCoder;

            m = Abc.DefineMethod(Sig.@from(sig), coder);

            _generator.NewApi.SetProtoFunction(type, sig.TraitName, m);

            val[0] = m;
        }
コード例 #2
0
        private static void TestBuiltinType(AbcFile abc, AvmTypeCode type)
        {
            var name = abc.BuiltinTypes[type];
            var mn   = abc.ImportConst(name);

            Assert.IsTrue(ReferenceEquals(name, mn));
        }
コード例 #3
0
 public AbcMultiname this[AvmTypeCode code]
 {
     get
     {
         int i = (int)code;
         return(_types[i] ?? (_types[i] = _abc.DefineName(Names[i])));
     }
 }
コード例 #4
0
        public static bool Is(this IType type, AvmTypeCode typeCode)
        {
            if (type == null)
            {
                return(false);
            }
            var instance = type.AbcInstance();

            if (instance == null)
            {
                return(false);
            }
            if (!instance.IsNative)
            {
                return(false);
            }
            return(instance.FullName == typeCode.FullName());
        }
コード例 #5
0
        void RegisterPrototype(AvmTypeCode type, string name, AbcCoder coder)
        {
            string key = GetKey(type, name);

            _prototypes[key] = new object[] { coder, null };
        }
コード例 #6
0
 static string GetKey(AvmTypeCode type, string name)
 {
     return((int)type + "." + name);
 }
コード例 #7
0
 public static string FullName(this AvmTypeCode typeCode)
 {
     return(BuiltinTypes.GetFullName(typeCode));
 }
コード例 #8
0
        public static string GetFullName(AvmTypeCode typeCode)
        {
            int i = (int)typeCode;

            return(Names[i].FullName);
        }