Merge pull request #2196 from robertbrignull/visit_null_children

JavaScript parse tree visitor: check if ctx.children is non-null in visitChildren
This commit is contained in:
Terence Parr 2018-07-24 15:54:06 -07:00 committed by GitHub
commit fc01366f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -73,7 +73,11 @@ ParseTreeVisitor.prototype.visit = function(ctx) {
};
ParseTreeVisitor.prototype.visitChildren = function(ctx) {
return this.visit(ctx.children);
if (ctx.children) {
return this.visit(ctx.children);
} else {
return null;
}
}
ParseTreeVisitor.prototype.visitTerminal = function(node) {