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

Don't check what's returned from passed function #24

Merged
merged 2 commits into from
Mar 11, 2015

Conversation

adam-lynch
Copy link
Contributor

  1. By default, CoffeeScript will return the last line in a function. If you had the following:

    .pipe($.rename (path) =>
            path.extname = '.html'
    )

    Then your gulp task would fail with TypeError: Arguments to path.join must be strings, unless you end the function with return path / return / return a falsy value.

  2. It's kinda ambiguous / confusing. I can't think of a use case where you'd edit the original but return something else (since the original will overridden with what you return anyway).


I didn't check the tests, I just made this change on github.com. If they fail, I'll come back to them later.

@adam-lynch
Copy link
Contributor Author

Ok, I almost forgot to come back to this. I'll sort this over the weekend.

@adam-lynch
Copy link
Contributor Author

Done, ready for merge. Travis is reporting a build error above as you can see. The tests passed with node 0.10 but on 0.9 it failed due to an npm glitch. Re-run the build or just merge as is, you can see the tests passing here.

@shinnn
Copy link
Collaborator

shinnn commented Dec 17, 2014

+1

@shinnn
Copy link
Collaborator

shinnn commented Mar 11, 2015

OK, I'll merge this PR since it's more suitable for the bahavior described in README. I regard this change as a bug fix.

However, it's debatable whether using return value is more useful for the users or not.

Thanks, @adam-lynch :)

shinnn added a commit that referenced this pull request Mar 11, 2015
Don't check what's returned from passed function
@shinnn shinnn merged commit 7cb3edc into hparra:master Mar 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants