New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScriptEngine.ExecuteFile hangs permanently instead of throwing JavaScriptException #138

Closed
Metalnem opened this Issue Jan 2, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@Metalnem
Copy link

Metalnem commented Jan 2, 2019

ScriptEngine.ExecuteFile sometimes hangs permanently instead of throwing JavaScriptException when encountering syntactically invalid JavaScript code. Here is the full program that reproduces such behavior:

namespace Jurassic.Run
{
  public class Program
  {
    public static void Main(string[] args)
    {
      new ScriptEngine().Execute("for(a=0;a<2;a++[1])1");
    }
  }
}

Chrome and Safari display the following error when running this JavaScript snippet:

SyntaxError: Unexpected token '['.

Found via SharpFuzz.

@paulbartrum

This comment has been minimized.

Copy link
Owner

paulbartrum commented Jan 3, 2019

The issue here is not that the loop hangs, it's that a++[1] doesn't produce a syntax error (it should).

@paulbartrum paulbartrum added the bug label Jan 6, 2019

@paulbartrum

This comment has been minimized.

Copy link
Owner

paulbartrum commented Jan 7, 2019

A good catch, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment