Skip to content

Use correct bound helper params#3410

Merged
rwjblue merged 1 commit intoember-cli:masterfrom
jbrown:patch-1
Mar 6, 2015
Merged

Use correct bound helper params#3410
rwjblue merged 1 commit intoember-cli:masterfrom
jbrown:patch-1

Conversation

@jbrown
Copy link
Contributor

@jbrown jbrown commented Mar 3, 2015

No description provided.

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.

3 participants