Browse Source

Updated esprima-dotnet reference (#664)

* Updated Esprima package from 1.0.0-beta-1186 to 1.0.0-beta-1202
* Added test for handling parser exception of javascript parser.
Ahmet Kakıcı 5 years ago
parent
commit
14033f2b94
2 changed files with 13 additions and 2 deletions
  1. 12 1
      Jint.Tests/Parser/JavascriptParserTests.cs
  2. 1 1
      Jint/Jint.csproj

+ 12 - 1
Jint.Tests/Parser/JavascriptParserTests.cs

@@ -172,5 +172,16 @@ namespace Jint.Tests.Parser
         {
             Assert.Throws<JavaScriptException>(() => new Engine().Execute("~ (WE0=1)--- l('1');"));
         }
+
+
+        [Theory]
+        [InlineData("....")]
+        [InlineData("while")]
+        [InlineData("var")]
+        [InlineData("-.-")]
+        public void ShouldThrowParserExceptionForInvalidCode(string code)
+        {
+            Assert.Throws<ParserException>(() => new JavaScriptParser(code).ParseProgram());
+        }
     }
-}
+}

+ 1 - 1
Jint/Jint.csproj

@@ -7,6 +7,6 @@
     <LangVersion>latest</LangVersion>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="Esprima" Version="1.0.0-beta-1186" />
+    <PackageReference Include="Esprima" Version="1.0.0-beta-1202" />
   </ItemGroup>
 </Project>