Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #92 this.parseError is not a function #104

Merged

Conversation

mpalmerlee
Copy link
Contributor

@mpalmerlee mpalmerlee commented May 11, 2024

By adding a parseError property to the parser.yy object we avoid the error this.parseError is not a function and we can re-throw the underlying error with a more useful error message.

This works because the parser.yy object gets copied to the sharedState object here:
https://github.com/zaach/jison/blob/master/lib/jison.js#L1393

Then because sharedState.parseError is defined it is used rather than undefined here:
https://github.com/zaach/jison/blob/master/lib/jison.js#L1409

Fixes #92

@jgravois
Copy link
Member

thanks for making this contribution @mpalmerlee. i'll make time to take a look at this soon.

Copy link
Member

@jgravois jgravois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks again @mpalmerlee. much appreciated! 🙏

@jgravois jgravois merged commit 536a86c into terraformer-js:main May 15, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

this.parseError is not a function
2 participants