Skip to content

Conversation

@Serabe
Copy link
Member

@Serabe Serabe commented Sep 15, 2015

This fixes the behaviour when a positional param conflicts conflicts with
a hash param.

Copy link
Member

Choose a reason for hiding this comment

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

I think this should be positionalParams[paramsStartIndex + i].

Copy link
Member Author

Choose a reason for hiding this comment

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

No, the for is iterating through the positionalParams array. The paramsStartIndex accounts for the difference if the first parameter is the name of the component (because of the component helper) or a direct invocation. @mixonic got rid of that in #12285 but it is a WIP

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha, thank you for explaining.

Copy link
Member

Choose a reason for hiding this comment

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

Can you make this an assertion though?

Basically:

assert(`You cannot specify both a positional param (at position ${i}) and the hash argument \`${positionalParams[i]}\`.`, positonalParams[i] in attrs);

Then the tests get updated to something like:

expectAssertion(function() {
  runAppend(view);
}, /The message from above, I am too lazy to type/);

This fixes the behaviour when a positional param conflicts conflicts with
a hash param.
@Serabe Serabe force-pushed the positional-parameters branch from 3aa9f6e to 9edd17f Compare September 15, 2015 21:51
rwjblue added a commit that referenced this pull request Sep 15, 2015
[BUGFIX beta] Change preference in positional parameters
@rwjblue rwjblue merged commit 299f801 into emberjs:master Sep 15, 2015
@rwjblue
Copy link
Member

rwjblue commented Sep 15, 2015

Thank you!

SaladFork added a commit to SaladFork/ember-paper that referenced this pull request Jan 28, 2016
Ideally we wouldn't need a separate `positionalIcon` property and could
just use `icon`, but this is not permitted (see emberjs/ember.js#12350)
SaladFork added a commit to SaladFork/ember-paper that referenced this pull request Jan 28, 2016
Ideally we wouldn't need a separate `positionalIcon` property and could
just use `icon`, but this is not permitted (see emberjs/ember.js#12350)
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