-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Fix HasteImpl Regex #24628
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 HasteImpl Regex #24628
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
|
Thank you @CaptainNic. Do you mind signing the CLA so I can merge this PR? |
|
@cpojer I'm working on figuring out the CLA issue, I was under the assumption that I was already covered under my company's CLA. |
|
You may need to talk to somebody at your company to get yourself added. I'm assuming @matthargett will be able to help you out :) |
pluginNameReducers was not properly escaping a backslash, resulting in unintended regex behavior.
16e5c34 to
3c257fa
Compare
|
I tried to merge this, but the import tool is unable to find a valid CLA on file. I just looked around our CLA tool and could not find @CaptainNic listed in the CLA. Let me follow up internally and see what's up. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
facebook-github-bot
left a comment
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.
@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
This pull request was successfully merged by @CaptainNic in 28e0de0. When will my fix make it into a release? | Upcoming Releases |
Summary:
The jest HasteImpl's `pluginNameReducers` regex was not properly escaping a backslash, resulting in unintended behavior.
The intent of the code is to strip the `.${name}` from the end of a filepath, where `name` is a platform name. The correct regex for that would be `^(.*)\.(myPlat)$`, but because the regex is being constructed from a string, the `\.` is being interpreted as an escaped period, resulting in the regex `^(.*).(myPlat)$`. To correct this, the backslash needs to be escaped so it makes it into the regex.
[General] [Fixed] - Fix HasteImpl platform name regex
Pull Request resolved: #24628
Differential Revision: D15224468
Pulled By: hramos
fbshipit-source-id: 6eb507aa5410bdd7c247e6d301052d41995a2f11
Summary
The jest HasteImpl's
pluginNameReducersregex was not properly escaping a backslash, resulting in unintended behavior.The intent of the code is to strip the
.${name}from the end of a filepath, wherenameis a platform name. The correct regex for that would be^(.*)\.(myPlat)$, but because the regex is being constructed from a string, the\.is being interpreted as an escaped period, resulting in the regex^(.*).(myPlat)$. To correct this, the backslash needs to be escaped so it makes it into the regex.Changelog
[General] [Fixed] - Fix HasteImpl platform name regex
Test Plan
This is a stripped down version of
jest/hasteImpl.jsfor testing. Can also be found at https://codepen.io/anon/pen/wZNovr?editors=0011Output: