Browse Source

refactor: avoid leading semi

Evan You 8 years ago
parent
commit
f2b476d4f4
1 changed files with 7 additions and 5 deletions
  1. 7 5
      src/core/observer/array.js

+ 7 - 5
src/core/observer/array.js

@@ -8,10 +8,7 @@ import { def } from '../util/index'
 const arrayProto = Array.prototype
 export const arrayMethods = Object.create(arrayProto)
 
-/**
- * Intercept mutating methods and emit events
- */
-;[
+const methodsToPatch = [
   'push',
   'pop',
   'shift',
@@ -19,7 +16,12 @@ export const arrayMethods = Object.create(arrayProto)
   'splice',
   'sort',
   'reverse'
-].forEach(function (method) {
+]
+
+/**
+ * Intercept mutating methods and emit events
+ */
+methodsToPatch.forEach(function (method) {
   // cache original method
   const original = arrayProto[method]
   def(arrayMethods, method, function mutator (...args) {