Skip to content
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.

Fixed transformAST.TypeName #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZeframLou
Copy link

In transformAST.TypeName, it is possible for ctx.children to be null. An example scenario is when the last argument of a function definition has a trailing comma.

The existing implementation assumes ctx.children has the property length, which causes an exception when ctx.children is null. This commit fixes this issue by adding an if statement that checks for this condition. If ctx.children is indeed null, the fixed version returns this.visit(ctx.getChild(0)), which is the default return value used in the existing implementation.

In transformAST.TypeName, it is possible for ctx.children to be null. An example scenario is when the last argument of a function definition has a trailing comma.

The existing implementation assumes ctx.children has the property 'length', which causes an exception when ctx.children is null. This commit fixes this issue by adding an if statement.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant