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 SyntaxError: Illegal return statement #4

Merged
merged 1 commit into from
Dec 17, 2019

Conversation

gitim
Copy link

@gitim gitim commented Dec 16, 2019

Faced with SyntaxError in this package, because some package in my project depend from this package.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

See inspect-js/is-set#4 (review)

This is not a syntax error whatsoever; this is a node module and top level return is allowed in it.

What bundler are you using that breaks on valid node modules?

@ljharb ljharb added invalid This doesn't seem right wontfix This will not be worked on labels Dec 16, 2019
@ljharb
Copy link
Member

ljharb commented Dec 16, 2019

@@ -20,7 +19,6 @@ if (!$mapHas) {
// `Map` does not have a `has` method
return false;
};
return;

Choose a reason for hiding this comment

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

Even if you were to get rid of these returns, this is not it; you need to convert the rest of the file into else bodies.

@ljharb ljharb merged commit a0a0d4a into inspect-js:master Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants