protected void TestMethodDecompilation(MethodBase mb)
        {
            Flash["Method Being Decompiled"] = mb;
            Func<Lambda> decompile = () => mb.Decompile(Semantics.CSharp35_WithDebugInfo);
            1.UpTo(10).Select(_ => decompile().Body).Ping();
            var lam = decompile();

            Func<String> dumpAsText = () => String.Format("{1}{0}{2}",
                Environment.NewLine, lam.Sig.DumpAsText(),  lam.Body.DumpAsText());
            1.UpTo(10).ForEach(_ => dumpAsText());
            var s_actual = dumpAsText();
            VerifyResult(s_actual);
        }
示例#2
0
 public static Lambda Decompile(this Semantics semantics, MethodBase mb)
 {
     var domain = new Domain(semantics);
     if (semantics == Domain.Current.Semantics) domain = Domain.Current;
     return mb.Decompile(domain);
 }
示例#3
0
 public static Lambda Decompile(this Language language, MethodBase mb)
 {
     return mb.Decompile(new Semantics(language, true));
 }