-
-
Notifications
You must be signed in to change notification settings - Fork 3
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 "return" outside of function issue #5
Conversation
@ljharb 🤦♂️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIFEs are obsolete; that's never an acceptable solution.
I very explicitly chose to export the proper function, which will be much faster, rather than polluting a single function with all the logic of each case.
If I decide to change my perfectly valid node CJS module to avoid top-level return, I'll use another approach.
If you don't want to introduce changes due to some philosophical that's another thing, but this change is perfectly viable. |
(Let’s discuss on the is-map PR) |
Closes #5. Closes #4. Closes #3. Closes inspect-js/node-deep-equal#78. Closes es-shims/Promise.allSettled#7. Closes airbnb/js-shims#12. Relates to inspect-js/is-set#4, inspect-js/is-set#5 Addresses storybookjs/storybook#9154.
Closes #5. Closes #4. Closes #3. Closes inspect-js/node-deep-equal#78. Closes es-shims/Promise.allSettled#7. Closes airbnb/js-shims#12. Relates to inspect-js/is-map#3, inspect-js/is-map#4, inspect-js/is-map#5 Addresses storybookjs/storybook#9154.
Closes inspect-js/node-deep-equal#79. Closes inspect-js/node-deep-equal#78. Closes es-shims/Promise.allSettled#7. Closes airbnb/js-shims#12. Relates to: - inspect-js/is-map#5 - inspect-js/is-map#4 - inspect-js/is-map#3 - inspect-js/is-set#5 - inspect-js/is-set#4 - storybookjs/storybook#9154.
Closes inspect-js/node-deep-equal#79. Closes inspect-js/node-deep-equal#78. Closes es-shims/Promise.allSettled#7. Closes airbnb/js-shims#12. Relates to: - inspect-js/is-map#5 - inspect-js/is-map#4 - inspect-js/is-map#3 - inspect-js/is-set#5 - inspect-js/is-set#4 - storybookjs/storybook#9154.
Should solve these errors - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Bad_return_or_yield
storybookjs/storybook#9154
Corresponding PR in
is-map
- inspect-js/is-map#5