Skip to content

Commit 4f8f4db

Browse files
committed
simplify source with rest params
1 parent 213f136 commit 4f8f4db

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/core/observer/array.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,7 @@ export const arrayMethods = Object.create(arrayProto)
2323
.forEach(function (method) {
2424
// cache original method
2525
const original = arrayProto[method]
26-
def(arrayMethods, method, function mutator () {
27-
// avoid leaking arguments:
28-
// http://jsperf.com/closure-with-arguments
29-
let i = arguments.length
30-
const args = new Array(i)
31-
while (i--) {
32-
args[i] = arguments[i]
33-
}
26+
def(arrayMethods, method, function mutator (...args) {
3427
const result = original.apply(this, args)
3528
const ob = this.__ob__
3629
let inserted

0 commit comments

Comments
 (0)