Engine.Execute can throw many unexpected exceptions
Metalnem opened this issue · comments
Nemanja Mijailovic commented
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.
Marko Lahma commented
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.