Skip to content

Commit

Permalink
simplify source with rest params
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 17, 2017
1 parent 213f136 commit 4f8f4db
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/core/observer/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@ export const arrayMethods = Object.create(arrayProto)
.forEach(function (method) {
// cache original method
const original = arrayProto[method]
def(arrayMethods, method, function mutator () {
// avoid leaking arguments:
// http://jsperf.com/closure-with-arguments
let i = arguments.length
const args = new Array(i)
while (i--) {
args[i] = arguments[i]
}
def(arrayMethods, method, function mutator (...args) {
const result = original.apply(this, args)
const ob = this.__ob__
let inserted
Expand Down

0 comments on commit 4f8f4db

Please sign in to comment.