Skip to content

fix directive sort compare #3776

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

Merged
merged 2 commits into from
Sep 27, 2016
Merged

fix directive sort compare #3776

merged 2 commits into from
Sep 27, 2016

Conversation

defcc
Copy link
Member

@defcc defcc commented Sep 26, 2016

fix #3768

Object.keys(groupedMap) returns an array whose elements are strings, so it breaks the sort function.

@posva
Copy link
Member

posva commented Sep 26, 2016

Thanks! LGTM
I'm not sure about the test though

@defcc
Copy link
Member Author

defcc commented Sep 27, 2016

Ok, current test case seems not to fully cover the code. I will try to update the test case soon

}
array.push(dir)
}

var index = 0
var priorities = Object.keys(groupedMap).sort(function (a, b) {
var priorities = keys.sort(function (a, b) {
Copy link
Member

Choose a reason for hiding this comment

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

sort is in-place, so we can just name this array priorities from the start, no need to assign a separate variable.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, I have updated the code :)

@defcc
Copy link
Member Author

defcc commented Sep 27, 2016

forgot it. I will fix it later today

@yyx990803 yyx990803 merged commit eca73f2 into vuejs:dev Sep 27, 2016
@yyx990803
Copy link
Member

Thanks! 👍

@juukie
Copy link

juukie commented Sep 28, 2016

Thanks, fixed the bug 👍

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.

Directive params casted into strings
4 participants