refactor: move exec-child logic into main function#1186
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1186 +/- ##
==========================================
+ Coverage 97.28% 97.38% +0.09%
==========================================
Files 36 36
Lines 1364 1452 +88
==========================================
+ Hits 1327 1414 +87
- Misses 37 38 +1 ☔ View full report in Codecov by Sentry. |
d6deca2 to
2f78e2e
Compare
No change to logic. This refactors the exec-child.js script to move all of its main logic into a main() function. This function is only invoked if the script is executed, not when it is imported. Importing the script is now a NOOP instead of throwing an exception. It's still not advisable to import the script, however this can be done if absolutely necessary to trick JavaScript bundlers which try to prune non-imported code files. Partially related to issue #1160 and #1172.
2f78e2e to
014d8ff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No change to logic. This refactors the exec-child.js script to move all of its main logic into a main() function. This function is only invoked if the script is executed, not when it is imported.
Importing the script is now a NOOP instead of throwing an exception. It's still not advisable to import the script, however this can be done if absolutely necessary to trick JavaScript bundlers which try to prune non-imported code files.
Partially related to issue #1160 and #1172.