Jint.JintJsException: Invalid IL code in (wrapper dynamic-method) Jint.Marshal.ProxyHelper:dynamicPropertyGetter (Jint.Marshaller,Jint.Native.JsDictionaryObject): method body is empty

Mar 19, 2013 at 11:38 PM
Hi, I am getting this error on every script, I am running Jint inside a .Net application which is running on Mono. Has anyone seen this before?

This is part of the stack trace:

System.Delegate CreateDelegate 0 0
System.Delegate CreateDelegate 0 0
System.Reflection.Emit.DynamicMethod CreateDelegate 0 0
Jint.Marshal.ProxyHelper WrapGetProperty 0 0
Jint.Marshaller WrapGetProperty 0 0
Jint.Marshaller MarshalPropertyInfo 0 0
Jint.Native.NativeConstructor .ctor 0 0
Jint.Native.NativeTypeConstructor Wrap 0 0
Jint.Marshaller CreateConstructor 0 0
Jint.Marshaller MarshalType 0 0
Jint.Marshaller MarshalClrValue 0 0
Jint.Native.NativeDescriptor Get 0 0
Jint.Native.JsDictionaryObject TryGetProperty 0 0
.....

Looking inside NativeConstructor.cs there is only two calls to MarshalPropertyInfo:
        // find and add all static properties and fields
        foreach (var info in type.GetProperties(BindingFlags.Static | BindingFlags.Public))
            DefineOwnProperty(Global.Marshaller.MarshalPropertyInfo(info, this));
and
        foreach (var info in type.GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public))
        {
            ParameterInfo[] indexerParams = info.GetIndexParameters();
            if (indexerParams == null || indexerParams.Length == 0)
                m_properties.AddLast(global.Marshaller.MarshalPropertyInfo(info, this));
It seems like a similar issue to this: https://bugzilla.xamarin.com/show_bug.cgi?id=6821#c5

Any help would be amazing

Thanks