Skip to content
New issue

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

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

Already on GitHub? # to your account

Throw ERRBadAwait instead of ERRnoSemic if applicable #6955

Merged
merged 5 commits into from
Apr 16, 2024

Conversation

ShortDevelopment
Copy link
Contributor

Issue

It might happen that a developer forgets to declare a function as async but still uses await as a keyword.
In this case the CC parser will just display a ERRnoSemic as seen in #5103.

Changes

According to the proposal of @rhuanjl in #5103 (comment) the parser now checks if the previous token was a tkID equal to await.
In that case the parser throws a ERRBadAwait.


Fixes #5103

@rhuanjl
Copy link
Collaborator

rhuanjl commented Oct 7, 2023

Thanks for the contribution, it would be nice to see this changed.

Unfortunately the test fails look legitimate to me, (as in this appears to have introduced a new bug) if you can work out what's gone wrong that would be great, if not I'll try and investigate on Monday or Tuesday.

@ShortDevelopment
Copy link
Contributor Author

ShortDevelopment commented Nov 10, 2023

@rhuanjl Comparing the CI output of a PR with "no code" and mine it seems like the failing tests might be unrelated to the changes in this PR

Both failed with

Total: passed 1382, failed 630

@rhuanjl
Copy link
Collaborator

rhuanjl commented Apr 16, 2024

@rhuanjl Comparing the CI output of a PR with "no code" and mine it seems like the failing tests might be unrelated to the changes in this PR

Both failed with

Total: passed 1382, failed 630

Seems you were right, CI is sorted now, this PR looks good though I'd ideally not like to introduce the TS comments to our codebase.

@ShortDevelopment
Copy link
Contributor Author

@rhuanjl Comments are removed

Seems you were right, CI is sorted now

It's still a bit scary to have CI failing randomly

@rhuanjl
Copy link
Collaborator

rhuanjl commented Apr 16, 2024

@rhuanjl Comments are removed

Seems you were right, CI is sorted now

It's still a bit scary to have CI failing randomly

I think it was an issue ages ago that's been fixed in the meantime...

I'll gain additional confidence of that if it passes again now having already passed once before you removed the comments.

@rhuanjl rhuanjl merged commit 469795b into chakra-core:master Apr 16, 2024
21 checks passed
@ShortDevelopment ShortDevelopment deleted the feat-parse-await-notice branch May 4, 2024 21:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhelpful Error Message - Should be missing 'async' keyword instead of Expected ';'
2 participants