- Home /
External DLL + Unityscript = Not Implemented
I am trying to implement JavaScript modding using Jurassic, a javascript parser. I can get it working with C#, but not with Unityscript. When i try to run some code, it gives me a "Not Implemented" error.
NotImplementedException: The requested feature is not implemented.
System.Reflection.Emit.DynamicMethod.GetDynamicILInfo ()
Jurassic.Compiler.DynamicILGenerator..ctor (System.Reflection.Emit.DynamicMethod dynamicMethod)
Jurassic.Library.FunctionBinder.CreateSingleMethodBinder (Int32 argumentCount, Jurassic.Library.FunctionBinderMethod binderMethod)
Jurassic.Library.FunctionBinder.CreateBinder (Int32 argumentCount)
Jurassic.Library.FunctionBinder.Call (Jurassic.ScriptEngine engine, System.Object thisObject, System.Object[] arguments)
Jurassic.Library.ClrFunction.ConstructLateBound (System.Object[] argumentValues)
Jurassic.JavaScriptException.CreateError (Jurassic.ScriptEngine engine, System.String name, System.String message)
Jurassic.JavaScriptException..ctor (Jurassic.ScriptEngine engine, System.String name, System.String message, Int32 lineNumber, System.String sourcePath)
Jurassic.Compiler.Parser.ParseExpression (Jurassic.Compiler.Token[] endTokens)
Jurassic.Compiler.Parser.ParseLabelOrExpressionStatement ()
Jurassic.Compiler.Parser.ParseStatementNoNewContext ()
Jurassic.Compiler.Parser.ParseStatement ()
Jurassic.Compiler.Parser.Parse ()
Jurassic.Compiler.GlobalMethodGenerator.Parse ()
Jurassic.ScriptEngine.Execute (Jurassic.ScriptSource source)
Jurassic.ScriptEngine.Execute (System.String code)
ParserTester.Update () (at Assets/ParserTester.js:5)
I am using Unity 3.5 with a free license. I have tried calling Jurassic both via import
and defining a variable, with no success.
Answer by rutter · Mar 24, 2012 at 11:52 PM
It looks like the Mono runtime Unity relies on may not support that GetDynamicILInfo()
call. If you search around the net a bit, there are a number of people asking about similar problems over the past few years. There may be workarounds, but I'm not aware of any immediate solution.
I see. Then probably I'd need a parser, not a runtime compiler. But the C# scripting doesn't also use $$anonymous$$ono? How does it work in C# and not in US? I could also write a simple wrapper class in C# that just passes on to Jurassic's functions, but that's too hacky. Id' prefer using it as a ultimate solution
I agree that does seem strange. =\ Unity does create separate assemblies for US and C#, so I wonder if there may be some crucial distinction between them.
I tried JS parsers with no successs (jint and javascriptdotnet). I guess I'm going LUA! I hate that syntax, but whatever. Or maybe i'll do that wrapper.