Skip to content

object的倒序排列会在一些特殊环境下造成影响(如数据库字段依赖JSON顺序时) #2072

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 1 commit into from
Dec 24, 2015

Conversation

galenyuan
Copy link

#2008
解决此issue中出现的特殊问题
发现和解决都是@yuhere 做的,我只是帮他提一个PR

@@ -48,8 +48,7 @@ export function Observer (value) {

Observer.prototype.walk = function (obj) {
var keys = Object.keys(obj)
var i = keys.length
while (i--) {
for (var i = 0; i < keys.length; i++) {
Copy link
Member

Choose a reason for hiding this comment

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

这里三处都按惯例 cache 一下数组长度吧,var i = 0, l = keys.length; i < l; i++

Copy link
Member

Choose a reason for hiding this comment

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

另外修改完毕后最好合并成一个 commit(force push 到原 branch 即可)

@galenyuan
Copy link
Author

@yyx990803 哦了

yyx990803 added a commit that referenced this pull request Dec 24, 2015
object的倒序排列会在一些特殊环境下造成影响(如数据库字段依赖JSON顺序时)
@yyx990803 yyx990803 merged commit fa53d96 into vuejs:dev Dec 24, 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