Parsing/evaluation errors not being thrown in Mono?

Aug 17, 2011 at 9:19 PM

I am running Jint (latest binary release) under Mono 2.6.7 (latest stable version), which should work, right?

However, it appears that error exceptions are not working.  I made the simple test program below to illustrate the odd behavior I am seeing (please see results following program).   You will note that:

* the second call to Run (with obviously incorrect JS syntax) prints out "5" again!

* the third call to Run (with an obviously unbound variable) seems to print out the empty string.

Any advice appreciated.  Thanks,

-Chuck

TEST PROGRAM:

using System;
using Jint;
namespace TestJint
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            JintEngine engine = new JintEngine();
            engine.DisableSecurity();
            engine.SetDebugMode(true);
            Console.WriteLine(engine.Run("2+3"));
            Console.WriteLine("after0");
            Console.WriteLine(engine.Run(")(---"));
            Console.WriteLine("after1");
            Console.WriteLine(engine.Run("FOOBAR"));
            Console.WriteLine("after2");
        }
    }
}

RESULTS:

5
after0
5
after1

after2

Aug 17, 2011 at 11:51 PM

I just fixed the wrong return result.

The syntax errors though are not fixed, I have to figure out what is happening.

Aug 18, 2011 at 3:10 AM

There seem to be some known issues (resulting in this behavior) between Antlr and Mono, which are under discussion with the Antlr folks.  -CR