Merge branch 'master' into pmd/7.0.x

This commit is contained in:
Andreas Dangel
2021-05-21 11:20:23 +02:00
8 changed files with 287 additions and 106 deletions

View File

@@ -11,6 +11,10 @@
<relativePath>../</relativePath>
</parent>
<properties>
<java.version>8</java.version>
</properties>
<build>
<resources>
<resource>
@@ -80,6 +84,7 @@
<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<version>1.7.13</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>

View File

@@ -6,6 +6,7 @@ package net.sourceforge.pmd.lang.ecmascript.ast;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
@@ -178,4 +179,13 @@ public class EcmascriptParserTest extends EcmascriptParserTestBase {
ASTAssignment infix = rootNode.getFirstDescendantOfType(ASTAssignment.class);
assertEquals("^=", infix.getImage());
}
/**
* [javascript] Failing with OutOfMemoryError parsing a Javascript file #2081
*/
@Test(timeout = 5000L)
public void shouldNotFailWithOutOfMemory() {
ASTAstRoot rootNode = js.parse("(``\n);");
assertNotNull(rootNode);
}
}