In trunk, cannot access enum more than once?

Apr 19, 2010 at 7:01 PM

Hi all,

I just download the trunk from SVN (thanks for your help, Nicolas!) and found that something that used to work for me no longer does.  I cannot get an enum value more than once.

using System;
using Jint;

namespace JintTrunkEnumIssue
{
    public enum Values
    {
        Value1 = 1,
        Value2 = 2,
    }

    public static class Class1
    {
        static void Main(String[] args)
        {
            JintEngine engine = new JintEngine();

            foreach (Values v in Enum.GetValues(typeof(Values)))
            {
                for (Int32 i = 0; i < 2; i++)
                {
                    String name = "JintTrunkEnumIssue.Values." + v;
                    Object o = engine.Run(name);

                    Console.Out.WriteLine("{0} ({1}) is {2}", name, o, o != null ? o.GetType().ToString() : "null");
                }
            }
            Console.ReadKey();
        }
    }
}

gets me

JintTrunkEnumIssue.Values.Value1 (Value1) is JintTrunkEnumIssue.Values
JintTrunkEnumIssue.Values.Value1 () is null
JintTrunkEnumIssue.Values.Value2 () is null
JintTrunkEnumIssue.Values.Value2 () is null