Skip to content

ScriptEngine.ExecuteFile hangs permanently instead of throwing JavaScriptException #138

Closed

Description

@Metalnem

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.

Activity

  1. paulbartrum commented on Jan 3, 2019

    @paulbartrum
    Owner

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

  2. paulbartrum commented on Jan 7, 2019

    @paulbartrum
    Owner

    A good catch, thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions