forked from jasder/antlr
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:
commit
fc01366f35
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue