Taritsyn/MsieJavaScriptEngine

Parsing JSLint

benquarmby opened this issue · 2 comments

I have been trying to run the latest JSLint under Chakra using this tool. It would solve a bunch of issues for JSLint.NET.

Unfortunately the latest edition of jslint.js doesn't get past the parser - it falls over on a property named "continue" (legal in ES5). When I debug, I can see that it's using the ChakraJsEngine, but that doesn't seem to change how it's parsed.

I don't know much about how ActiveScript works, but is there some way to change the parser to use whatever IE9+ is using?

Hello, Bquarmby!

Unfortunately, impossible to run the ActiveScript version of the Chakra in the ES5 compatibility mode (only supported ES3).

If you have installed the Internet Explorer 11, then you can install the MSIE JavaScript Engine v1.3.0, that includes the JsRT version of Chakra (supports ES5):

using (var jsEngine = new MsieJsEngine(JsEngineMode.ChakraJsRt))
{
    jsEngine.ExecuteResource("TestJsLint.Resources.jslint.js", typeof (...));
    ...
}

If this variant does not suit you, then I recommend you to try my other project - JavaScriptEngineSwitcher.

Thanks for all the information. JsRT will be perfect for JSLint.NET once IE11 is more mainstream.

It turns out it's also possible to put a System.Windows.Forms.WebBrowser control into es5 mode and execute scripts that way. The only problem is that it requires a single threaded apartment context, which isn't always possible. Deal breaker for MSBuild.

I'll close this issue.