Esempio n. 1
0
        internal AbcMethod DefineMethod(Sig sig, AbcCoder coder)
        {
            var method = new AbcMethod
            {
                ReturnType = sig.ReturnType != null
                                                         ? DefineTypeNameSafe(sig.ReturnType)
                                                         : null
            };

            if (sig.Args != null)
            {
                AddParameters(method.Parameters, sig.Args);
            }

            var body = new AbcMethodBody(method);

            AddMethod(method);

            if (coder != null)
            {
                var code = new AbcCode(this);
                coder(code);
                body.Finish(code);
            }

            return(method);
        }
Esempio n. 2
0
 internal void Finish(AbcCode code)
 {
     if (_body == null)
     {
         throw new InvalidOperationException("Method has no body");
     }
     _body.Finish(code);
 }