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

JavaScript: avoid assertion failures when making an empty tag #3428

Merged

Conversation

masatake
Copy link
Member

@masatake masatake commented Jul 5, 2022

Related to #900, #1112, and #3427.

When the parser tries making a tag with empty name, an assertion
in registerEntry fails. The parser side should be fixed but it
will take a time. This change puts guard conditions around
registerEntry to avoid the failures.

THIS IS A TEMPORARILY SOLUTION.

Signed-off-by: Masatake YAMATO [email protected]

Related to universal-ctags#900, universal-ctags#1112, and universal-ctags#3427.

When the parser tries making a tag with empty name, an assertion
in registerEntry fails. The parser side should be fixed but it
will take a time. This change puts guard conditions around
registerEntry to avoid the failures.

THIS IS A TEMPORARILY SOLUTION.

Signed-off-by: Masatake YAMATO <[email protected]>
@masatake masatake requested a review from jafl July 5, 2022 22:15
@codecov
Copy link

codecov bot commented Jul 5, 2022

Codecov Report

Merging #3428 (cf68aae) into master (b6ac374) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3428   +/-   ##
=======================================
  Coverage   83.35%   83.35%           
=======================================
  Files         218      218           
  Lines       52487    52488    +1     
=======================================
+ Hits        43749    43750    +1     
  Misses       8738     8738           
Impacted Files Coverage Δ
parsers/jscript.c 97.58% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6ac374...cf68aae. Read the comment docs.

Copy link
Contributor

@jafl jafl left a comment

Choose a reason for hiding this comment

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

I was just going to submit a PR for this :)

@masatake
Copy link
Member Author

masatake commented Jul 5, 2022

Testing on BSDs becomes a bottleneck of development.

@masatake
Copy link
Member Author

masatake commented Jul 5, 2022

I was just going to submit a PR for this :)

I recognized the assertion failures with codebase.
https://docs.ctags.io/en/latest/contributions.html#add-realistic-examples-for-you-parser-to-codebase

You know JavaScript well. So you can run semi-test JavaScript in your brain.
However, I am not. This is not only JavaScript but all other languages than C.
So I have gathered REAL source code for various languages for testing parsers of ctags.

See https://github.com/universal-ctags/codebase. I think this is useful for a developer even if the one knows well about the target language.

@masatake masatake merged commit b074114 into universal-ctags:master Jul 5, 2022
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.

2 participants