|
|
@@ -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
|