Skip to content

Commit

Permalink
fix: sortObject should not introduce formerly non-existent fields
Browse files Browse the repository at this point in the history
(cherry picked from commit e585fc3)
  • Loading branch information
sodatea committed Oct 10, 2019
1 parent a0fc87a commit 8feaef0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/@vue/cli/lib/util/sortObject.js
Expand Up @@ -4,8 +4,10 @@ module.exports = function sortObject (obj, keyOrder, dontSortByUnicode) {

if (keyOrder) {
keyOrder.forEach(key => {
res[key] = obj[key]
delete obj[key]
if (obj.hasOwnProperty(key)) {
res[key] = obj[key]
delete obj[key]
}
})
}

Expand Down

0 comments on commit 8feaef0

Please sign in to comment.