content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 02:24:46 GMT 2024
   */
  
  package org.mozilla.javascript;
  
  import org.junit.jupiter.api.Test;
  import static org.junit.jupiter.api.Assertions.*;
  import org.junit.jupiter.api.Timeout;
  import java.util.concurrent.TimeUnit;
  import static org.evosuite.runtime.EvoAssertions.*;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  import org.mozilla.javascript.CompilerEnvirons;
  import org.mozilla.javascript.Decompiler;
  import org.mozilla.javascript.DefaultErrorReporter;
  import org.mozilla.javascript.ErrorReporter;
  import org.mozilla.javascript.Parser;
  import org.mozilla.javascript.ScriptOrFnNode;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class Parser_ESTest extends Parser_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReportErrorThrowsRuntimeException() throws Throwable  {
        // Given a parser with a compiler environment and an error reporter
        CompilerEnvirons environs = new CompilerEnvirons();
        Parser parser = new Parser(environs, (ErrorReporter) null);
        
        // When the reportError method is called with an empty string as argument
        try {
        parser.reportError("");
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        // Then an exception should be thrown due to the absence of a message resource for the message property
        verifyException("org.mozilla.javascript.ScriptRuntime$DefaultMessageProvider", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPopScopeThrowsNullPointerException() throws Throwable  {
        // No Comments were added
        Parser parser = new Parser((CompilerEnvirons) null, (ErrorReporter) null);
        // Undeclared exception!
        try { 
          parser.popScope();
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.mozilla.javascript.Parser", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddErrorTakingStringThrowsRuntimeException() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        ErrorReporter arg1 = arg0.getErrorReporter();
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.addError("3EK6EObam<1Zj7?G");
          fail("Expecting exception: RuntimeException");
        
        } catch(RuntimeException e) {
           //
           // no message resource found for message property 3EK6EObam<1Zj7?G
           //
           verifyException("org.mozilla.javascript.ScriptRuntime$DefaultMessageProvider", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsNullPointerExceptionAndParseWithNegative0() throws Throwable  {
        CompilerEnvirons arg0 = new CompilerEnvirons();
        Parser parser = new Parser(arg0, (ErrorReporter) null);
        // Undeclared exception!
        try {
        parser.parse("vc[hm^1]$", "D>SyUZg!N[", (-1817));
        } catch(NullPointerException e) {
        // The parse method threw a NullPointerException because the argument "(-1817)" is not a valid string value.
        verifyException("org.mozilla.javascript.Parser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsNullPointerExceptionAndParseWithPositive0() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        Parser parser = new Parser(arg0, (ErrorReporter) null);
        // Undeclared exception!
        try { 
          parser.parse("q,W?Y:]{mMEix}Dp", "q,W?Y:]{mMEix}Dp", 7);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.mozilla.javascript.Parser", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddWarning() throws Throwable  {
        // Given a compiler environment and an error reporter
        CompilerEnvirons environs = new CompilerEnvirons();
        ErrorReporter reporter = environs.getErrorReporter();
        
        // When we create a parser with the compiler environment and error reporter
        Parser parser = new Parser(environs, reporter);
        
        // And we parse some code using the parser
        ScriptOrFnNode parse = parser.parse("!Oqvr7v", "!Oqvr7v", 83);
        
        // Then the line number of the parsed code should be equal to 83
        assertEquals(83, parse.getLineno());
        
        // And there should be a warning added to the parser about using varargs in a function
        parser.addWarning("msg.varargs.fun", "");
        
        // And the encoded source of the parsed code should be equal to the expected value
        assertEquals("\u0087\u001A'\u0006Oqvr7vQ\u0001", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseReturningScriptOrFnNodeWhereGetLinenoIsZero() throws Throwable  {
        // Given a CompilerEnvirons instance and a DefaultErrorReporter instance
        CompilerEnvirons env = new CompilerEnvirons();
        DefaultErrorReporter err = DefaultErrorReporter.instance;
        
        // When we create a new Parser instance with these objects as arguments
        Parser parser = new Parser(env, err);
        
        // And we parse the script "u" with language version 16 and starting at line 0
        ScriptOrFnNode ast = parser.parse("u", "language version 16", 0);
        
        // Then the end line number of the AST should be 0
        assertEquals(0, ast.getEndLineno());
        
        // And the AST should have children
        assertTrue(ast.hasChildren());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testInsideFunction() throws Throwable  {
        // Given a parser with default environs and error reporter
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        
        // When we create a new parser with the given environs and reporter
        Parser parser = new Parser(environs, reporter);
        
        // Then the function insideFunction should return false
        assertFalse(parser.insideFunction());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetEncodedSourceReturningNonEmptyString() throws Throwable  {
        // Given a CompilerEnvirons object and an ErrorReporter object, we create a new Parser instance.
        CompilerEnvirons environs = new CompilerEnvirons();
        ErrorReporter reporter = environs.getErrorReporter();
        Parser parser = new Parser(environs, reporter);
        
        // When we parse the source code "!Oqvr7v" with the parser, and we specify that it should be parsed as a script or function node.
        ScriptOrFnNode parse = parser.parse("!Oqvr7v", "!Oqvr7v", 95);
        
        // Then we assert that the line number of the parsed code is equal to 95.
        assertEquals(95, parse.getLineno());
        
        // Given the encoded source code for the parsed script or function node.
        String encodedSource = parser.getEncodedSource();
        
        // When we compare the encoded source code with a known value.
        assertEquals("\u0087\u001A'\u0006Oqvr7vQ\u0001", encodedSource);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetCurrentLineNumber() throws Throwable  {
        // Given a compiler environs object
        CompilerEnvirons environs = new CompilerEnvirons();
        
        // And an error reporter
        ErrorReporter reporter = environs.getErrorReporter();
        
        // When we create a parser with the environs and reporter objects
        Parser parser = new Parser(environs, reporter);
        
        // And parse a string "~yMn"
        parser.parse("~yMn", "", 1442);
        
        // Then the parser should return an encoded source of "\u0087\u001B'\u0003yMnQ\u0001"
        assertEquals("\u0087\u001B'\u0003yMnQ\u0001", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateDecompiler() throws Throwable  {
        // Given: A CompilerEnvirons object and a DefaultErrorReporter instance
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter defaultErrorReporter = DefaultErrorReporter.instance;
        
        // When: Creating a Parser object with the given environs and error reporter
        Parser parser = new Parser(compilerEnvirons, defaultErrorReporter);
        
        // Then: The createDecompiler method should return an instance of Decompiler
        assertEquals(2, Decompiler.TO_SOURCE_FLAG);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive0() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.parse("+D:+>[m/%Z|1BtNBbXP", "+D:+>[m/%Z|1BtNBbXP", 105);
          fail("Expecting exception: RuntimeException");
        
        } catch(RuntimeException e) {
           //
           // missing ; before statement (+D:+>[m/%Z|1BtNBbXP#105)
           //
           verifyException("org.mozilla.javascript.DefaultErrorReporter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse0() throws Throwable  {
        // Create a new compiler environment with default settings
        CompilerEnvirons env = new CompilerEnvirons();
        
        // Use the default error reporter for the parser
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        
        // Parse the input string "factory == null" using the given environment and reporter
        Parser parser = new Parser(env, reporter);
        ScriptOrFnNode parse = parser.parse("factory == null", "factory == null", 120);
        
        // Assert that the parsed source code is the same as the input string
        assertEquals("\u0087'\u0007factory\f*Q\u0001", parser.getEncodedSource());
        
        // Assert that the end line number of the parsed code is 120
        assertEquals(120, parse.getEndLineno());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive1() throws Throwable  {
        // Given a parser with default error reporter
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, errorReporter);
        
        // When attempting to parse a JavaScript source code with an undeclared switch statement
        String sourceCode = "XfnY2Y:";
        try {
        parser.parse(sourceCode, "msg.no.paren.switch", 100);
        fail("Expecting exception: RuntimeException");
        } catch (RuntimeException e) {
        // Then an unexpected end of file error is reported with the correct message and position
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive2() throws Throwable  {
        CompilerEnvirons envs = new CompilerEnvirons();
        DefaultErrorReporter errReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(envs, errReporter);
        
        try {
        parser.parse("~{!B#7R?aEYjq7", "~{!B#7R?aEYjq7", 10);
        fail("Expecting exception: RuntimeException");
        } catch (RuntimeException e) {
        // Verify that the thrown exception is an instance of DefaultErrorReporter
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive3() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        ErrorReporter reporter = environs.getErrorReporter();
        Parser parser = new Parser(environs, reporter);
        
        // Test that an exception is thrown when the syntax of the input is invalid
        try {
        parser.parse("g%{bQ", "g%{bQ", 113);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        // Verify that the expected exception was thrown
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsNullPointerExceptionAndParseWithPositive1() throws Throwable  {
        CompilerEnvirons arg0 = new CompilerEnvirons();
        Parser parser = new Parser(arg0, (ErrorReporter) null);
        
        // Try to parse a null input
        try {
        parser.parse("![3kK", "![3kK", 16);
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        // Verify that the thrown exception is an instance of NullPointerException
        verifyException("org.mozilla.javascript.Parser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse1() throws Throwable  {
        // Given a Parser object with the CompilerEnvirons and DefaultErrorReporter
        CompilerEnvirons env = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(env, errorReporter);
        
        // When we call the parse method with an empty string, "[]", and a line number of 107
        parser.parse("[]", "[]", 107);
        
        // Then the encoded source should be equal to "\u0087RSQ\u0001"
        assertEquals("\u0087RSQ\u0001", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsNullPointerExceptionAndParseWithPositive2() throws Throwable  {
        // Given a CompilerEnvirons object
        CompilerEnvirons env = new CompilerEnvirons();
        
        // And a Parser object initialized with the CompilerEnvirons object and no error reporter
        Parser parser = new Parser(env, (ErrorReporter) null);
        
        // When we try to parse the "class Test { public static void main(String[] args) { System.out.println(\"Hello World\"); } }" code snippet with the parser
        try {
        parser.parse("class Test { public static void main(String[] args) { System.out.println(\"Hello World\"); } }", "Test.java", 16);
        
        // Then we expect an exception to be thrown
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        //
        // no message in exception (getMessage() returned null)
        //
        verifyException("org.mozilla.javascript.Parser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive4() throws Throwable  {
        // No Comments were added
        CompilerEnvirons arg0 = new CompilerEnvirons();
        ErrorReporter arg1 = arg0.getErrorReporter();
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.parse("/=g_WAKZvJ9o&V]!O4", "m;@)Zk[o{Mn'hJw", 21);
          fail("Expecting exception: RuntimeException");
        
        } catch(RuntimeException e) {
           //
           // unterminated regular expression literal (m;@)Zk[o{Mn'hJw#21)
           //
           verifyException("org.mozilla.javascript.DefaultErrorReporter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse2() throws Throwable  {
        // Given
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        
        // When
        ScriptOrFnNode parse = parser.parse("[1, 2, 3, 4, 5]", "[1, 2, 3, 4, 5]", 107);
        
        // Then
        assertEquals("\u0087R(S\u0001X(S\u0002X(S\u0003X(S\u0004X(S\u0005SQ\u0001", parser.getEncodedSource());
        assertEquals(107, parse.getLineno());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse3() throws Throwable  {
        // Given
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, errorReporter);
        
        // When
        ScriptOrFnNode parse = parser.parse("this", "this", 47);
        
        // Then
        assertEquals("\u0087+Q\u0001", parser.getEncodedSource());
        assertEquals(47, parse.getEndLineno());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsNullPointerExceptionAndParseWithPositive3() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        Parser parser = new Parser(environs, null);
        
        // Given: A JavaScipt Parser object with a CompilerEnvirons instance and no error reporter
        
        try {
        parser.parse("/z2*/|>", "get", 987);
        
        // When: The parse method is called with a JavaScript source code string, the name of a method to invoke, and an integer argument
        
        fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        // Then: An exception is thrown because the JavaScript source code string is not declared
        
        verifyException("org.mozilla.javascript.Parser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive5() throws Throwable  {
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter defaultErrorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, defaultErrorReporter);
        
        // This test verifies that the parser throws a RuntimeException when it encounters an illegal character in the input string.
        String inputString = "q::_f=";
        int lineNumber = 2379;
        
        try {
        parser.parse(inputString, inputString, lineNumber);
        fail("Expected RuntimeException to be thrown");
        } catch (RuntimeException e) {
        // Verify that the exception is of type org.mozilla.javascript.DefaultErrorReporter
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsIllegalStateException0() throws Throwable  {
        // Create a new CompilerEnvirons object
        CompilerEnvirons compilerEnv = new CompilerEnvirons();
        
        // Create a new Parser object with the CompilerEnvirons object and a null ErrorReporter
        Parser parser = new Parser(compilerEnv, (ErrorReporter) null);
        
        // Try to parse a string that contains an invalid expression
        try {
        parser.parse("@ee*uC", "@ee*uC", (-1186));
        
        // If the code reaches this point, it means that no exception was thrown, which is unexpected
        fail("Expecting exception: IllegalStateException");
        } catch(IllegalStateException e) {
        // Verify that the thrown exception is of type IllegalStateException
        verifyException("org.mozilla.javascript.Kit", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithEmptyString() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, errorReporter);
        
        // Test that an exception is thrown when parsing an invalid expression
        try {
        parser.parse("*@(gt", "", -1970);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        verifyException("org.mozilla.javascript.RhinoException", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive6() throws Throwable  {
        // Setup
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, errorReporter);
        
        // Test
        try {
        parser.parse("i.@9&of2|PXwGFeo}yW", "i.@9&of2|PXwGFeo}yW", 188);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        // Verify that the expected exception was thrown
        assertEquals(e.getClass(), RuntimeException.class);
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse4() throws Throwable  {
        // Arrange
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        
        // Act
        Parser parser = new Parser(environs, reporter);
        ScriptOrFnNode parse = parser.parse("ms.bad.throw.eol", "ms.bad.throw.eol", 13);
        
        // Assert
        assertEquals(27, parse.getEncodedSourceEnd());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsNullPointerExceptionAndParseWithNegative1() throws Throwable  {
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        Parser parser = new Parser(compilerEnvirons, (ErrorReporter) null);
        // Undeclared exception!
        try {
        // Parse a message with a switch statement that has a default case.
        parser.parse("msg.double.switch.default", "msg.double.switch.default", (-1771));
        fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
        //
        // The message has a switch statement with a default case, and the value of the switch expression is -1771, which does not match any of the cases.
        // Therefore, an exception is expected to be thrown when trying to parse the message.
        verifyException("org.mozilla.javascript.Parser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive7() throws Throwable  {
        // Given: a JUnit test for the Parser class in the Mozilla Rhino project
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        
        // When: the parse() method is called with a malformed input string
        try {
        parser.parse("~Y.(%Bn_/rE", "~Y.(%Bn_/rE", 1480);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        // Then: a syntax error is reported by the DefaultErrorReporter instance
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse5() throws Throwable  {
        // Given: we have a Parser object with a CompilerEnvirons object and a DefaultErrorReporter object
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        
        // When: we parse the string "(new B,olban(false))" with the parser
        ScriptOrFnNode parseResult = parser.parse("(new B,olban(false))", "(new B,olban(false))", 24);
        
        // Then: we assert that the parse result is not null and has a lineno of 24
        assertNotNull(parseResult);
        assertEquals(24, parseResult.getLineno());
        
        // And: we assert that the parsed source code is equal to "\u0087V\u001E'\u0001BX'\u0005olbanV,WWQ\u0001"
        assertEquals("\u0087V\u001E'\u0001BX'\u0005olbanV,WWQ\u0001", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse6() throws Throwable  {
        // Given a default error reporter and a compiler environs object
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        CompilerEnvirons compilerEnv = new CompilerEnvirons();
        
        // When we create a parser with these objects
        Parser parser = new Parser(compilerEnv, errorReporter);
        
        // And we parse the input string "(new Boolban(true))"
        parser.parse("(new Boolban(true))", "(new Boolban(true))", 1843);
        
        // Then the parsed source code should be encoded as "\u0087V\u001E'\u0007BoolbanV-WWQ\u0001"
        assertEquals("\u0087V\u001E'\u0007BoolbanV-WWQ\u0001", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive8() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, reporter);
        
        // Given a valid input string and a position
        String input = "VB(pvfJ,ZoBv";
        int position = 2567;
        
        try {
        // When we parse the input at the given position
        parser.parse(input, input, position);
        
        // Then we expect an exception to be thrown
        fail("Expecting exception: RuntimeException");
        } catch (RuntimeException e) {
        // And the exception message should match the expected error message
        assertEquals("missing ) after argument list (VB(pvfJ,ZoBv#2567)", e.getMessage());
        
        // Verify that the exception is of type DefaultErrorReporter and has the correct message
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsIllegalArgumentException0() throws Throwable  {
        // Given a Parser object with a CompilerEnvirons instance and a DefaultErrorReporter instance
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter defaultErrorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, defaultErrorReporter);
        
        // When the parse method is called with an invalid input string and a negative number as a third parameter
        try {
        parser.parse("resumeGenerator() not implemented", "propertyIsEnumerable", (-11));
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        // Then an IllegalArgumentException is thrown with a message that includes the third parameter value of -11
        verifyException("org.mozilla.javascript.RhinoException", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsIllegalArgumentException1() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        ErrorReporter arg1 = arg0.getErrorReporter();
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.parse("<_{bQ", "<_{bQ", (-1733));
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // -1733
           //
           verifyException("org.mozilla.javascript.RhinoException", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive9() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        Parser parser = new Parser(arg0, arg1);
        arg0.setXmlAvailable(false);
        // Undeclared exception!
        try { 
          parser.parse("<><_", "Some example input", 5);
          fail("Expecting exception: RuntimeException");
        
        } catch(RuntimeException e) {
           //
           // syntax error (Some example input#5)
           //
           verifyException("org.mozilla.javascript.DefaultErrorReporter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsIllegalArgumentException2() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.parse("void ", "C)\"~I$3fC~G", (-1683));
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // -1683
           //
           verifyException("org.mozilla.javascript.RhinoException", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive10() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        ErrorReporter reporter = environs.getErrorReporter();
        Parser parser = new Parser(environs, reporter);
        
        // Given a language version that is not supported by the parser
        int languageVersion = 12;
        
        try {
        // When the parse method is called with an invalid language version
        parser.parse("--", "language version", languageVersion);
        
        // Then an exception should be thrown
        fail("Expecting exception: RuntimeException");
        } catch (RuntimeException e) {
        // Verify that the correct exception was thrown
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive11() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, reporter);
        
        // This test case expects a RuntimeException to be thrown due to an unexpected end of file
        try {
        parser.parse("typeof", "set", 128);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive12() throws Throwable  {
        // Given: A Parser object created with the CompilerEnvirons and DefaultErrorReporter classes
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        
        // When: The parse method is called with a string that contains a syntax error
        try {
        parser.parse("K%z}", "K%z}", 12);
        } catch(RuntimeException e) {
        // Then: An exception is thrown due to the syntax error in the input
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive13() throws Throwable  {
        // Create a new CompilerEnvirons object.
        CompilerEnvirons arg0 = new CompilerEnvirons();
        
        // Create a new DefaultErrorReporter instance.
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        
        // Create a new Parser object with the specified arguments.
        Parser parser = new Parser(arg0, arg1);
        
        // Parse a string that is not in the expected format (i.e., YYYY-MM-DDTHH:mm:ss.SSSZ).
        try {
        parser.parse("2023-11-14T18:19:17.123Z", "2023-11-14T18:19:17.123Z", 16);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        // Verify that the expected exception was thrown.
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive14() throws Throwable  {
        // Given
        CompilerEnvirons environs = new CompilerEnvirons();
        ErrorReporter errorReporter = environs.getErrorReporter();
        Parser parser = new Parser(environs, errorReporter);
        
        // When
        try {
        parser.parse("Dhr>>fJt'g2Z7", "Dhr>>fJt'g2Z7", 2000);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        // Then
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive15() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, reporter);
        
        // This test case is designed to check if the parser throws a RuntimeException when an undeclared exception occurs.
        
        try {
        parser.parse("O>nyUc!CN[", "O>nyUc!CN[", 88);
        fail("Expecting exception: RuntimeException");
        
        } catch(RuntimeException e) {
        // This is the expected behavior since the parse method throws a RuntimeException when an undeclared exception occurs.
        
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithNull() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        
        // Given a parser with a script containing invalid syntax
        Parser parser = new Parser(environs, reporter);
        String script = "vmpq<=vaW0^";
        
        // When the script is parsed with a null scope and an offset of 26
        try {
        parser.parse(script, null, 26);
        
        // Then an exception should be thrown indicating an unexpected end of file
        fail("Expecting exception: RuntimeException");
        } catch (RuntimeException e) {
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive16() throws Throwable  {
        // Arrange
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        
        // Act
        try {
        parser.parse("K<j$ny_?SFUI7;r[", "K<j$ny_?SFUI7;r[", 1154);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        // Assert
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsIllegalStateException1() throws Throwable  {
        // Given a CompilerEnvirons instance and a DefaultErrorReporter instance
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        
        // When the Parser is initialized with these instances
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        
        // Then an IllegalStateException is thrown when trying to parse an invalid input string
        try {
        parser.parse("POU&E", "POU&E", (-1206));
        fail("Expecting exception: IllegalStateException");
        } catch (IllegalStateException e) {
        // Verify that the correct exception was thrown
        verifyException("org.mozilla.javascript.Kit", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse7() throws Throwable  {
        // Given a string of code and the name of a variable
        String code = "foo != null && bar == baz";
        String variableName = "foo";
        
        // When the parser is invoked with the code and the name of the variable
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        ScriptOrFnNode parse = parser.parse(code, variableName, 100);
        
        // Then the encoded source should be as expected
        assertEquals("\u0087'\u0003foo\r*h'\u0003bar\f'\u0003bazQ\u0001", parser.getEncodedSource());
        
        // And the end lineno should be as expected
        assertEquals(100, parse.getEndLineno());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive17() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, reporter);
        
        // The test input is a JavaScript program with a syntax error
        String script = "yOzEE||~]s[0?{wZ<";
        
        try {
        parser.parse(script, script, 12);
        fail("Expecting exception: RuntimeException");
        } catch (RuntimeException e) {
        // Verify that the correct exception was thrown with a syntax error message
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsNullPointerExceptionAndParseWithPositive4() throws Throwable  {
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        Parser parser = new Parser(compilerEnvirons, null);
        
        try {
        // Parse the input with a length of 51 characters.
        parser.parse("i+tR9g,nxmt?0c\"", "i+tR9g,nxmt?0c\"", 51);
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        // Verify that the thrown exception is an instance of NullPointerException.
        assertTrue(e instanceof NullPointerException);
        
        // Verify that the thrown exception has no message.
        assertEquals(null, e.getMessage());
        
        // Verify that the stack trace contains the expected method names.
        StackTraceElement[] stackTrace = e.getStackTrace();
        for (int i = 0; i < stackTrace.length; i++) {
        String methodName = stackTrace[i].getMethodName();
        assertTrue(methodName.equals("parse") || methodName.equals("testParse_throwsNullPointerException_whenInputIsInvalid"));}}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDefineSymbolWithFalse() throws Throwable  {
        // Set up
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        
        // Execute
        parser.parse("msg.no.parm", "msg.no.parm", 56);
        parser.defineSymbol(152, false, "msg.no.paren.after.let");
        
        // Verify
        assertEquals("\u0087'\u0003msgk'\u0002nok'\u0004parmQ\u0001", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDefineSymbol0() throws Throwable  {
        // Given a string of code to be parsed
        String code = "bQ";
        
        // When the parser is run on that code
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, reporter);
        ScriptOrFnNode parse = parser.parse(code, "bQ", 16);
        
        // Then the parser should return a valid AST
        assertNotNull(parse);
        
        // And the base line number of the parsed code should be set correctly
        assertEquals(16, parse.getBaseLineno());
        
        // And the source code should be properly encoded and escaped
        parser.defineSymbol(153, true, "setUTCMinutes");
        assertEquals("\u0087'\u0003bQQ\u0001", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDefineSymbol1() throws Throwable  {
        // Create a new CompilerEnvirons object with default settings
        CompilerEnvirons compilerEnv = new CompilerEnvirons();
        
        // Create a new DefaultErrorReporter object to handle errors during parsing
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        
        // Create a new Parser object with the specified settings and error reporter
        Parser parser = new Parser(compilerEnv, errorReporter);
        
        // Parse the given string "get language version"
        ScriptOrFnNode parse = parser.parse("get", "language version", 120);
        
        // Assert that the parsed node has the correct line number (120)
        assertEquals(120, parse.getBaseLineno());
        
        // Assert that the parsed node has the correct source name ("language version")
        assertEquals("language version", parse.getSourceName());
        
        // Define a new symbol with the specified properties
        parser.defineSymbol(121, true, "get");
        
        // Assert that the defined symbol is correctly encoded in the source code
        assertEquals("\u0087'\u0003getQ\u0001", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDefineSymbolThrowsIllegalStateException() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        Parser parser = new Parser(arg0, arg1);
        parser.parse("$pDDEqoyqLPd:dx", "$pDDEqoyqLPd:dx", 9);
        parser.defineSymbol(108, true, "$pDDEqoyqLPd:dx");
        // Undeclared exception!
        try { 
          parser.defineSymbol((-1), false, "$pDDEqoyqLPd:dx");
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // FAILED ASSERTION
           //
           verifyException("org.mozilla.javascript.Kit", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDefineSymbol2() throws Throwable  {
        // Given
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        String input = "msg.reserved.id";
        
        // When
        ScriptOrFnNode parseResult = parser.parse(input, input, 56);
        
        // Then
        assertEquals(56, parseResult.getEndLineno());
        
        // Given
        parser.defineSymbol(152, true, "msg.no.paren.after.let");
        
        // When
        String encodedSource = parser.getEncodedSource();
        
        // Then
        assertEquals("\u0087'\u0003msgk'\breservedk'\u0002idQ\u0001", encodedSource);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive18() throws Throwable  {
        // No Comments were added
        CompilerEnvirons arg0 = new CompilerEnvirons();
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.parse("''}1^6\"FwpLQD45a", "''}1^6\"FwpLQD45a", 31);
          fail("Expecting exception: RuntimeException");
        
        } catch(RuntimeException e) {
           //
           // syntax error (''}1^6\"FwpLQD45a#31)
           //
           verifyException("org.mozilla.javascript.DefaultErrorReporter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse8() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        ErrorReporter arg1 = arg0.getErrorReporter();
        Parser parser = new Parser(arg0, arg1);
        parser.parse("$pDDEqoyqLPd:dx", "$pDDEqoyqLPd:dx", 113);
        ScriptOrFnNode parse = parser.parse("$pDDEqoyqLPd:dx", "$pDDEqoyqLPd:dx", 21);
        assertEquals(21, parse.getEndLineno());
        assertEquals("\u0087'\f$pDDEqoyqLPdf\u0001'\u0002dxQ\u0001", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse9() throws Throwable  {
        // Given a string containing JavaScript code
        String script = "debugger; HelloWorld";
        
        // When the code is parsed using the Parser class
        CompilerEnvirons environs = new CompilerEnvirons();
        ErrorReporter reporter = environs.getErrorReporter();
        Parser parser = new Parser(environs, reporter);
        ScriptOrFnNode parse = parser.parse(script, "HelloWorld", 10);
        
        // Then the resulting parse tree should have the correct source name and line number
        assertEquals("HelloWorld", parse.getSourceName());
        assertEquals(10, parse.getLineno());
        
        // And the encoded source of the parse tree should match the original script
        assertEquals("\u0087\u009FQ\u0001", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsNullPointerExceptionAndParseWithPositive5() throws Throwable  {
        // Given a compiler environs instance, parser instance, and some input code
        CompilerEnvirons arg0 = new CompilerEnvirons();
        Parser parser = new Parser(arg0, (ErrorReporter) null);
        String inputCode = "const int x = 10;";
        
        // When we parse the input code with the parser
        try {
        parser.parse(inputCode, "const ", 21);
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        // Then an exception is thrown with a message indicating that the error was in the parser
        verifyException("org.mozilla.javascript.Parser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive19() throws Throwable  {
        CompilerEnvirons env = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(env, errorReporter);
        // Expecting exception due to missing parentheses around with-statement object (with#29)
        try {
        parser.parse("with", "with", 29);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsIllegalArgumentException3() throws Throwable  {
        // Given
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, reporter);
        
        try {
        // When
        parser.parse("do ", "do ", (-3130));
        
        // Then
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the correct exception is thrown
        verifyException("org.mozilla.javascript.RhinoException", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsIllegalArgumentException4() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, errorReporter);
        
        // Given: A switch keyword that is not a valid JavaScript statement
        String switchKeyword = "switch ";
        
        // When: We attempt to parse the invalid switch keyword
        try {
        parser.parse(switchKeyword, switchKeyword, -383);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Then: The method should throw an IllegalArgumentException with the correct message
        verifyException("org.mozilla.javascript.RhinoException", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive20() throws Throwable  {
        // Given: an instance of the Parser class with a CompilerEnvirons and DefaultErrorReporter objects
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, errorReporter);
        
        // When: the parse method is called with an invalid input string
        try {
        parser.parse(" if@d6(", " if@d6(", 122);
        } catch (RuntimeException e) {
        // Then: a RuntimeException should be thrown indicating that there is a missing opening parenthesis before the condition
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive21() throws Throwable  {
        // Given
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        ErrorReporter errorReporter = compilerEnvirons.getErrorReporter();
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        
        // When
        try {
        parser.parse(";vrSA2@9i-0b-", "!Oqvr7v", 72);
        fail("Expecting exception: RuntimeException");
        } catch (RuntimeException e) {
        // Then
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsIllegalArgumentException5() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.parse("try ", "try ", (-6061));
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // -6061
           //
           verifyException("org.mozilla.javascript.RhinoException", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive22() throws Throwable  {
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        
        // Parse the script "throw" with a line number of 105
        try {
        parser.parse("throw", "throw", 105);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsIllegalArgumentException6() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        ErrorReporter reporter = environs.getErrorReporter();
        Parser parser = new Parser(environs, reporter);
        try {
        // Try to parse invalid code with a negative maximum recursion depth
        parser.parse("return", "![3kK", -2048);
        // If we reach this point, an IllegalArgumentException should be thrown
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the exception is of the expected type
        verifyException("org.mozilla.javascript.RhinoException", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsIllegalArgumentException7() throws Throwable  {
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(environs, errorReporter);
        
        // Try to parse the break statement with an illegal argument
        try {
        parser.parse("break", "break", (-1139));
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Verify that the correct exception was thrown
        verifyException("org.mozilla.javascript.RhinoException", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse10() throws Throwable  {
        // Set up the compiler environment and error reporter
        CompilerEnvirons environs = new CompilerEnvirons();
        ErrorReporter errorReporter = environs.getErrorReporter();
        
        // Create a new parser instance with the given arguments
        Parser parser = new Parser(environs, errorReporter);
        
        // Parse the source code and get the parse tree root node
        ScriptOrFnNode parseTreeRoot = parser.parse("{}eU52auw", "{}eU52auw", 127);
        
        // Check that the parsed source code is equal to the expected encoded source
        assertEquals("\u0087'\beU52auwQ\u0001", parser.getEncodedSource());
        
        // Check that the parse tree root node has the expected base line number
        assertEquals(127, parseTreeRoot.getBaseLineno());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive23() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        ErrorReporter arg1 = arg0.getErrorReporter();
        Parser parser = new Parser(arg0, arg1);
        parser.calledByCompileFunction = true;
        // Undeclared exception!
        try { 
          parser.parse("function ", "W@c<4iYU?;1,kHcDy9q", 1788);
          fail("Expecting exception: RuntimeException");
        
        } catch(RuntimeException e) {
           //
           // missing ( before function parameters. (W@c<4iYU?;1,kHcDy9q#1788)
           //
           verifyException("org.mozilla.javascript.DefaultErrorReporter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive24() throws Throwable  {
        CompilerEnvirons arg0 = new CompilerEnvirons();
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        Parser parser = new Parser(arg0, arg1);
        
        // This test case is designed to verify that the parser throws a RuntimeException when it encounters a missing opening parenthesis for a function call (function #2802)
        
        try {
        parser.parse("function ", "function ", 2802);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        // This block is executed if the exception is thrown, verifying that the exception is of type RuntimeException and that it has a specific message.
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsNullPointerExceptionAndParseWithPositive6() throws Throwable  {
        // Given: A new CompilerEnvirons instance and a Parser instance
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        Parser parser = new Parser(compilerEnvirons, (ErrorReporter) null);
        
        // When: The parse method is called with a null input
        parser.parse("while ", "while ", 317);
        
        // Then: A NullPointerException should be thrown
        fail("Expecting exception: NullPointerException");
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive25() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        arg0.setXmlAvailable(false);
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.parse("@%OnIbS6c>B", "<_", 2146435072);
          fail("Expecting exception: RuntimeException");
        
        } catch(RuntimeException e) {
           //
           // XML runtime not available (<_#2146435072)
           //
           verifyException("org.mozilla.javascript.DefaultErrorReporter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive26() throws Throwable  {
        // Given: A Parser instance with a CompilerEnvirons and DefaultErrorReporter
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        DefaultErrorReporter errorReporter = DefaultErrorReporter.instance;
        Parser parser = new Parser(compilerEnvirons, errorReporter);
        
        // When: The parse() method is called with an invalid default namespace statement
        try {
        parser.parse("default", "default", 1024);
        fail("Expecting exception: RuntimeException");
        } catch(RuntimeException e) {
        // Then: An exception is thrown, indicating that the default namespace is not valid
        verifyException("org.mozilla.javascript.DefaultErrorReporter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParse11() throws Throwable  {
        // Set up the compiler environment and error reporter
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        
        // Create a parser instance with the given environment and error reporter
        Parser parser = new Parser(environs, reporter);
        
        // Parse the input string "++4(+3*6/2)"
        ScriptOrFnNode parse = parser.parse("++4(+3*6/2)", "exec", 1903);
        
        // Check that the parsed result is correct
        assertEquals("i(S\u0004V\u001C(S\u0003\u0017(S\u0006\u0018(S\u0002WQ\u0001", parser.getEncodedSource());
        assertEquals(1903, parse.getLineno());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseReturningScriptOrFnNodeWhereHasChildrenIsFalse() throws Throwable  {
        // Given a CompilerEnvirons object and a DefaultErrorReporter object
        CompilerEnvirons environs = new CompilerEnvirons();
        DefaultErrorReporter reporter = DefaultErrorReporter.instance;
        
        // When the Parser is instantiated with these objects
        Parser parser = new Parser(environs, reporter);
        
        // And a script or function node is parsed from the source code
        ScriptOrFnNode parse = parser.parse("\n    ", "\n    ", 6067);
        
        // Then the end line number of the parsed node should be equal to 6068
        assertEquals(6068, parse.getEndLineno());
        
        // And the encoded source code of the parsed node should match the expected value
        assertEquals("\u0087", parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddStrictWarning() throws Throwable  {
        // Given a CompilerEnvirons object and a Parser object
        CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
        Parser parser = new Parser(compilerEnvirons, null);
        
        // When the addStrictWarning method is called with two strings
        parser.addStrictWarning("p5*>egB=Qg-GjeGx,n", "p5*>egB=Qg-GjeGx,n");
        
        // Then the encodedSource of the Parser object should be null
        assertNull(parser.getEncodedSource());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive27() throws Throwable  {
        // No Comments were added
        CompilerEnvirons arg0 = new CompilerEnvirons();
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.parse("Ya|-w/{3}bC?wq]8", "Ya|-w/{3}bC?wq]8", 110);
          fail("Expecting exception: RuntimeException");
        
        } catch(RuntimeException e) {
           //
           // missing : after property id (Ya|-w/{3}bC?wq]8#110)
           //
           verifyException("org.mozilla.javascript.DefaultErrorReporter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseWithPositive28() throws Throwable  {
        // No Comments were added
        CompilerEnvirons arg0 = new CompilerEnvirons();
        DefaultErrorReporter arg1 = DefaultErrorReporter.instance;
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.parse("{hkU52auw", "{hkU52auw", 24);
          fail("Expecting exception: RuntimeException");
        
        } catch(RuntimeException e) {
           //
           // missing } in compound statement ({hkU52auw#24)
           //
           verifyException("org.mozilla.javascript.DefaultErrorReporter", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetEncodedSourceReturningNull() throws Throwable  {
        // Given: A new instance of the Parser class with a CompilerEnvirons and ErrorReporter objects
        CompilerEnvirons environs = new CompilerEnvirons();
        ErrorReporter reporter = environs.getErrorReporter();
        Parser parser = new Parser(environs, reporter);
        
        // When: The getEncodedSource method is called with no input
        String encodedSource = parser.getEncodedSource();
        
        // Then: The return value should be null
        assertNull(encodedSource);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddErrorTaking2ArgumentsThrowsNullPointerException() throws Throwable  {
        // rollbacked to evosuite
        CompilerEnvirons arg0 = new CompilerEnvirons();
        ErrorReporter arg1 = arg0.getErrorReporter();
        Parser parser = new Parser(arg0, arg1);
        // Undeclared exception!
        try { 
          parser.addError("msg.no.bracket.arg", "Invalid argument: Missing bracket");
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.mozilla.javascript.Parser", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseThrowsNullPointerExceptionAndParseWithPositive7() throws Throwable  {
        CompilerEnvirons arg0 = new CompilerEnvirons();
        Parser parser = new Parser(arg0, (ErrorReporter) null);
        // Try to parse a string with an invalid character "^oq["
        try {
        parser.parse("Zebra;92^oq[", "Zebra;92^oq[", 47);
        fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
        //
        // Verify that the parser throws a null pointer exception when an invalid character is encountered
        //
        verifyException("org.mozilla.javascript.Parser", e);}
    }
  }
  