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

Handle void object case #23

Closed
wants to merge 1 commit into from
Closed

Handle void object case #23

wants to merge 1 commit into from

Conversation

guybedford
Copy link
Collaborator

This adds void to the list of { prefix tokens that imply block statement braces.

Fixes #22.

Again, these are academic edge cases, and don't affect real world code.

@nicolo-ribaudo
Copy link
Contributor

nicolo-ribaudo commented Oct 29, 2020

Sorry, I think I wasn't clear in the issue 😅
The bug is the other way around: the regexp isn't correctly handled in the case without void.

I now think that the problem is that a { at the beginning of the file is not handled like other blocks (i.e. if I prefix it with if (foo) it works)

EDIT: This is a more readable test (but it currently throws instead of returning the wrong result):

{}

/'/.test(myString);

module.exports.foo = 2;

@guybedford
Copy link
Collaborator Author

Ah thanks for clarifying. If it's specifically to do with the start of the source it sounds like it might be a start check? Do you have an approach in mind here?

@guybedford guybedford closed this Oct 29, 2020
@guybedford guybedford deleted the void branch October 29, 2020 16:15
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.

Regexp/division after ]} not properly disambiguated
2 participants