Beispiel #1
0
        public void AddMethod(AbcMethod method)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }
            Methods.Add(method);
            var body = method.Body;

            if (body != null)
            {
                MethodBodies.Add(body);
            }
        }
Beispiel #2
0
        private AbcMethodBody ImportMethodBody(AbcMethodBody from, AbcMethod method)
        {
            if (from.ImportedBody != null)
            {
                return(from.ImportedBody);
            }

            var body = new AbcMethodBody(method);

            from.ImportedBody  = body;
            body.MaxStackDepth = from.MaxStackDepth;
            body.LocalCount    = from.LocalCount;
            body.MinScopeDepth = from.MinScopeDepth;
            body.MaxScopeDepth = from.MaxScopeDepth;
            MethodBodies.Add(body);

            ImportTraits(from, body);
            ImportExceptions(body, from);
            ImportIL(body, from);
            body.TranslateIndices();
            body.ResolveExceptionOffsets(this);

            return(body);
        }