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: don't use path.extname with undefined value #5683

Merged
merged 1 commit into from
Mar 27, 2016

Conversation

MylesBorins
Copy link
Contributor

In the current versions of node path.* can be called on any arbitrary
value and will return an empty string on invalid input.

As of node v6 path will assert that values passed to it are strings,
and as such will throw on undefined

This commit moved the logic of using path.extname inside of the
processText function in lib/cli-engine.js. so that it will not call
path.extname if a filename is not passed.

This change should not affect any other parts of the system, and the
test suite is 100% working on node v4, v5, and master.

fixes #5678

@eslintbot
Copy link

Thanks for the pull request, @thealphanerd! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary needs to begin with a tag (such as Fix: or Update:). Please check out our guide for how to properly format your commit summary and update it on this pull request.
  • Pull requests with code require an issue to be mentioned at the end of the commit summary, such as (fixes #1234). Please update the commit summary with an issue (file a new issue if one doesn't already exist).
  • Please sign our CLA. This is just a way for you to say that you give us permission to use your contribution.

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @ilyavolodin, @nzakas and @gyandeeps to be potential reviewers

@ilyavolodin
Copy link
Member

LGTM. Thanks for the change. Could you change commit message to "Fix: don't use path.extname with undefined value (fixes #5678)" please? We use fixes to generate changelog with links at release time.

In the current versions of node path.* can be called on any arbitrary
value and will return an empty string on invalid input.

As of node v6 path will assert that values passed to it are strings,
and as such will throw on `undefined`

This commit moved the logic of using `path.extname` inside of the
processText  function in `lib/cli-engine.js`. so that it will not call
`path.extname` if a filename is not passed.

This change should not affect any other parts of the system, and the
test suite is 100% working on node v4, v5, and master.

fixes eslint#5678
@MylesBorins
Copy link
Contributor Author

updated

@ilyavolodin
Copy link
Member

Awesome! Thanks for doing this. I'll merge this after next patch release.

@ilyavolodin ilyavolodin merged commit 21bd441 into eslint:master Mar 27, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test suite is broken on node master
4 participants