3
Vote

Mono support

description

Guys please support mono with all it's mac / linux folks, Jurassic is a piece of brilliant software which currently exists in an anti cross-platform state :'(

I'm ready to help with everything I can

comments

aikeru wrote Jun 20, 2012 at 11:42 PM

I'm not associated with the Jurassic project, but ... What about Jurassic doesn't work in Mono?

lu4 wrote Jun 21, 2012 at 12:18 PM

There are numerous issues that bump out suddenly where you wouldn't expect them to bump out

For example these three lines are not working:
var engine = new Jurassic.ScriptEngine();
engine.SetGlobalFunction("test", new Func<int, int, int>((a, b) => a + b));
Console.WriteLine(engine.Evaluate<int>("test(5, 6)"));


System.MethodAccessException has been thrown:

Method Test.MainClass:<Main>m__0 (int,int)' is inaccessible from method(wrapper dynamic-method) object:binder_for_Test.MainClass.<Main>m__0 (Jurassic.ScriptEngine,object,object[])'

Previously there were other problem with DynamicMethod, in mono DynamicMethod is not implemented. So following one of discussions found here, I've changed the property in ScriptEngine.cs to the following code:
    internal static bool LowPrivilegeEnvironment
    {
        get
        {
            lock (lowPrivilegeEnvironmentLock)
            {
                if (lowPrivilegeEnvironmentTested == false)
                {
                    if (Type.GetType("Mono.Runtime") != null)
                    {
                        lowPrivilegeEnvironment = true;
                        lowPrivilegeEnvironmentTested = true;
                    }
                    else
                    {
                        var permission = new System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode);
                        lowPrivilegeEnvironment = !System.Security.SecurityManager.IsGranted(permission);
                        lowPrivilegeEnvironmentTested = true;
                    }
                }
            }
            return lowPrivilegeEnvironment;
        }
    }
It helped with previous problem but posed new one....