This project has moved and is read-only. For the latest updates, please go here.

why there is no value of variable in LocalWindow ?

Jun 29, 2013 at 9:38 PM
Edited Jun 30, 2013 at 3:06 PM
Why there is no value of variable in LocalWindow, I looked at source code of GenerateCode method in MethodGenerator, the code look should display values. I have commented out these line as this was not important for me.
 //methodBuilder.DefineParameter(1, System.Reflection.ParameterAttributes.None, "scriptEngine");
 //methodBuilder.DefineParameter(2, System.Reflection.ParameterAttributes.None, "scope");
 //methodBuilder.DefineParameter(3, System.Reflection.ParameterAttributes.None, "thisValue");
I have a created a sample program, when I step into it just start displaying local values...and I matched with Jurassic code...but I dont know what I am missing in finding out the that line of code, which is just not displaying value of variables.
//mysample... here it works
Type typeSample = typeBuilder.CreateType();
typeSample .GetMethod("Main").Invoke(null, new string[] { null });  // F11(step into)
Jun 30, 2013 at 3:02 PM
I think Jurassic is not setting the value in LocalBuilder in the constructor of class ReflectionEmitILLocalVariable, and may be in the other methods too. It always get the name blank.
 public ReflectionEmitILLocalVariable(System.Reflection.Emit.LocalBuilder local, string name)
            if (local == null)
                throw new ArgumentNullException("local");
            this.UnderlyingLocal = local;
   = name;
          //  if (name != null)
          //     __local.SetLocalSymInfo(name);__
Any suggestion ???