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

Use correct bound helper params #3410

Merged
merged 1 commit into from
Mar 6, 2015
Merged

Use correct bound helper params #3410

merged 1 commit into from
Mar 6, 2015

Conversation

jbrown
Copy link
Contributor

@jbrown jbrown commented Mar 3, 2015

No description provided.

@@ -1,7 +1,7 @@
import Ember from 'ember';

export function <%= camelizedModuleName %>(input) {
return input;
export function <%= camelizedModuleName %>(params, hash, options, env) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bound helpers only get params and hash (the first two args).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should likely put the args in comments (otherwise the JSHint tests will blow up after generating):

export function <%= camelizedModuleName %>(/* params, hash, options, env */) {
}

And I think that the generate tests will also need to be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwjblue I'm a little confused, all the helpers I see in core have 4 params. Can you point me to some documentation on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helpers in core are not using Ember.HTMLBars.makeBoundHelper, since they are not bound helpers.

Documentation is here:

https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/lib/system/make_bound_helper.js#L18-L60

@jbrown jbrown changed the title Update helper params convention Use correct bound helper params Mar 3, 2015
@jbrown
Copy link
Contributor Author

jbrown commented Mar 4, 2015

@rwjblue Does it look okay now?

rwjblue added a commit that referenced this pull request Mar 6, 2015
Use correct bound helper params
@rwjblue rwjblue merged commit 0a21da1 into ember-cli:master Mar 6, 2015
@jbrown jbrown deleted the patch-1 branch March 6, 2015 20:34
@kimroen
Copy link
Contributor

kimroen commented Mar 10, 2015

@rwjblue
Copy link
Member

rwjblue commented Mar 10, 2015

@kimroen - You are correct, mind submitting a PR?

@kimroen
Copy link
Contributor

kimroen commented Mar 10, 2015

@rwjblue Done :)

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.

None yet

3 participants