sebastienros / jint

Javascript Interpreter for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Engine.Execute can throw many unexpected exceptions

Metalnem opened this issue · comments

Engine.Execute can throw many unexpected exceptions (JavaScriptException and ParserException are expected for malformed inputs) when executing scripts from the attached archive. These are:

  • ArgumentOutOfRangeException
  • IndexOutOfRangeException
  • InvalidCastException
  • InvalidOperationException
  • NullReferenceException
  • OverflowException

You can run the following code to reproduce it (the path variable should contain the path to one of the extracted files):

var text = File.ReadAllText(path);
new Engine().Execute(text);

Found via SharpFuzz.

Thank you for reporting these. We've created fixes for both Jint and Esprima .NET and they should now cover the cases you've reported, closing the issue.