Skip to content

Commit 3b3cc30

Browse files
committed
feat: stop using deprecated parser.
1 parent 19f957a commit 3b3cc30

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

gen.js/src/main/java/com/github/gumtreediff/gen/js/RhinoTreeGenerator.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
import com.github.gumtreediff.gen.SyntaxException;
2525
import com.github.gumtreediff.gen.TreeGenerator;
2626
import com.github.gumtreediff.tree.TreeContext;
27-
import org.mozilla.javascript.CompilerEnvirons;
28-
import org.mozilla.javascript.Context;
29-
import org.mozilla.javascript.EvaluatorException;
30-
import org.mozilla.javascript.Parser;
27+
import org.mozilla.javascript.*;
3128
import org.mozilla.javascript.ast.AstRoot;
3229

3330
import java.io.IOException;
@@ -43,7 +40,7 @@ public TreeContext generate(Reader r) throws IOException {
4340
env.setRecordingComments(true);
4441
Parser p = new Parser(env);
4542
try {
46-
AstRoot root = p.parse(r, null, 1);
43+
AstRoot root = p.parse(Kit.readReader(r), null, 1);
4744
RhinoTreeVisitor visitor = new RhinoTreeVisitor(root);
4845
root.visitAll(visitor);
4946
return visitor.getTreeContext();

0 commit comments

Comments
 (0)