瀏覽代碼

[build] 3.1.3

ktsn 5 年之前
父節點
當前提交
ac8a486b1b
共有 6 個文件被更改,包括 40 次插入32 次删除
  1. 9 7
      dist/vuex.common.js
  2. 9 7
      dist/vuex.esm.browser.js
  3. 2 2
      dist/vuex.esm.browser.min.js
  4. 9 7
      dist/vuex.esm.js
  5. 9 7
      dist/vuex.js
  6. 2 2
      dist/vuex.min.js

+ 9 - 7
dist/vuex.common.js

@@ -1,6 +1,6 @@
 /**
 /**
- * vuex v3.1.2
- * (c) 2019 Evan You
+ * vuex v3.1.3
+ * (c) 2020 Evan You
  * @license MIT
  * @license MIT
  */
  */
 'use strict';
 'use strict';
@@ -394,7 +394,10 @@ Store.prototype.commit = function commit (_type, _payload, _options) {
       handler(payload);
       handler(payload);
     });
     });
   });
   });
-  this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
+
+  this._subscribers
+    .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
+    .forEach(function (sub) { return sub(mutation, this$1.state); });
 
 
   if (
   if (
     process.env.NODE_ENV !== 'production' &&
     process.env.NODE_ENV !== 'production' &&
@@ -426,6 +429,7 @@ Store.prototype.dispatch = function dispatch (_type, _payload) {
 
 
   try {
   try {
     this._actionSubscribers
     this._actionSubscribers
+      .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
       .filter(function (sub) { return sub.before; })
       .filter(function (sub) { return sub.before; })
       .forEach(function (sub) { return sub.before(action, this$1.state); });
       .forEach(function (sub) { return sub.before(action, this$1.state); });
   } catch (e) {
   } catch (e) {
@@ -794,9 +798,7 @@ function enableStrictMode (store) {
 }
 }
 
 
 function getNestedState (state, path) {
 function getNestedState (state, path) {
-  return path.length
-    ? path.reduce(function (state, key) { return state[key]; }, state)
-    : state
+  return path.reduce(function (state, key) { return state[key]; }, state)
 }
 }
 
 
 function unifyObjectStyle (type, payload, options) {
 function unifyObjectStyle (type, payload, options) {
@@ -1039,7 +1041,7 @@ function getModuleByNamespace (store, helper, namespace) {
 var index = {
 var index = {
   Store: Store,
   Store: Store,
   install: install,
   install: install,
-  version: '3.1.2',
+  version: '3.1.3',
   mapState: mapState,
   mapState: mapState,
   mapMutations: mapMutations,
   mapMutations: mapMutations,
   mapGetters: mapGetters,
   mapGetters: mapGetters,

+ 9 - 7
dist/vuex.esm.browser.js

@@ -1,6 +1,6 @@
 /**
 /**
- * vuex v3.1.2
- * (c) 2019 Evan You
+ * vuex v3.1.3
+ * (c) 2020 Evan You
  * @license MIT
  * @license MIT
  */
  */
 function applyMixin (Vue) {
 function applyMixin (Vue) {
@@ -382,7 +382,10 @@ class Store {
         handler(payload);
         handler(payload);
       });
       });
     });
     });
-    this._subscribers.forEach(sub => sub(mutation, this.state));
+
+    this._subscribers
+      .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
+      .forEach(sub => sub(mutation, this.state));
 
 
     if (
     if (
       options && options.silent
       options && options.silent
@@ -412,6 +415,7 @@ class Store {
 
 
     try {
     try {
       this._actionSubscribers
       this._actionSubscribers
+        .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
         .filter(sub => sub.before)
         .filter(sub => sub.before)
         .forEach(sub => sub.before(action, this.state));
         .forEach(sub => sub.before(action, this.state));
     } catch (e) {
     } catch (e) {
@@ -769,9 +773,7 @@ function enableStrictMode (store) {
 }
 }
 
 
 function getNestedState (state, path) {
 function getNestedState (state, path) {
-  return path.length
-    ? path.reduce((state, key) => state[key], state)
-    : state
+  return path.reduce((state, key) => state[key], state)
 }
 }
 
 
 function unifyObjectStyle (type, payload, options) {
 function unifyObjectStyle (type, payload, options) {
@@ -996,7 +998,7 @@ function getModuleByNamespace (store, helper, namespace) {
 var index_esm = {
 var index_esm = {
   Store,
   Store,
   install,
   install,
-  version: '3.1.2',
+  version: '3.1.3',
   mapState,
   mapState,
   mapMutations,
   mapMutations,
   mapGetters,
   mapGetters,

文件差異過大導致無法顯示
+ 2 - 2
dist/vuex.esm.browser.min.js


+ 9 - 7
dist/vuex.esm.js

@@ -1,6 +1,6 @@
 /**
 /**
- * vuex v3.1.2
- * (c) 2019 Evan You
+ * vuex v3.1.3
+ * (c) 2020 Evan You
  * @license MIT
  * @license MIT
  */
  */
 function applyMixin (Vue) {
 function applyMixin (Vue) {
@@ -392,7 +392,10 @@ Store.prototype.commit = function commit (_type, _payload, _options) {
       handler(payload);
       handler(payload);
     });
     });
   });
   });
-  this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
+
+  this._subscribers
+    .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
+    .forEach(function (sub) { return sub(mutation, this$1.state); });
 
 
   if (
   if (
     process.env.NODE_ENV !== 'production' &&
     process.env.NODE_ENV !== 'production' &&
@@ -424,6 +427,7 @@ Store.prototype.dispatch = function dispatch (_type, _payload) {
 
 
   try {
   try {
     this._actionSubscribers
     this._actionSubscribers
+      .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
       .filter(function (sub) { return sub.before; })
       .filter(function (sub) { return sub.before; })
       .forEach(function (sub) { return sub.before(action, this$1.state); });
       .forEach(function (sub) { return sub.before(action, this$1.state); });
   } catch (e) {
   } catch (e) {
@@ -792,9 +796,7 @@ function enableStrictMode (store) {
 }
 }
 
 
 function getNestedState (state, path) {
 function getNestedState (state, path) {
-  return path.length
-    ? path.reduce(function (state, key) { return state[key]; }, state)
-    : state
+  return path.reduce(function (state, key) { return state[key]; }, state)
 }
 }
 
 
 function unifyObjectStyle (type, payload, options) {
 function unifyObjectStyle (type, payload, options) {
@@ -1037,7 +1039,7 @@ function getModuleByNamespace (store, helper, namespace) {
 var index_esm = {
 var index_esm = {
   Store: Store,
   Store: Store,
   install: install,
   install: install,
-  version: '3.1.2',
+  version: '3.1.3',
   mapState: mapState,
   mapState: mapState,
   mapMutations: mapMutations,
   mapMutations: mapMutations,
   mapGetters: mapGetters,
   mapGetters: mapGetters,

+ 9 - 7
dist/vuex.js

@@ -1,6 +1,6 @@
 /**
 /**
- * vuex v3.1.2
- * (c) 2019 Evan You
+ * vuex v3.1.3
+ * (c) 2020 Evan You
  * @license MIT
  * @license MIT
  */
  */
 (function (global, factory) {
 (function (global, factory) {
@@ -398,7 +398,10 @@
         handler(payload);
         handler(payload);
       });
       });
     });
     });
-    this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
+
+    this._subscribers
+      .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
+      .forEach(function (sub) { return sub(mutation, this$1.state); });
 
 
     if (
     if (
       options && options.silent
       options && options.silent
@@ -429,6 +432,7 @@
 
 
     try {
     try {
       this._actionSubscribers
       this._actionSubscribers
+        .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
         .filter(function (sub) { return sub.before; })
         .filter(function (sub) { return sub.before; })
         .forEach(function (sub) { return sub.before(action, this$1.state); });
         .forEach(function (sub) { return sub.before(action, this$1.state); });
     } catch (e) {
     } catch (e) {
@@ -797,9 +801,7 @@
   }
   }
 
 
   function getNestedState (state, path) {
   function getNestedState (state, path) {
-    return path.length
-      ? path.reduce(function (state, key) { return state[key]; }, state)
-      : state
+    return path.reduce(function (state, key) { return state[key]; }, state)
   }
   }
 
 
   function unifyObjectStyle (type, payload, options) {
   function unifyObjectStyle (type, payload, options) {
@@ -1042,7 +1044,7 @@
   var index = {
   var index = {
     Store: Store,
     Store: Store,
     install: install,
     install: install,
-    version: '3.1.2',
+    version: '3.1.3',
     mapState: mapState,
     mapState: mapState,
     mapMutations: mapMutations,
     mapMutations: mapMutations,
     mapGetters: mapGetters,
     mapGetters: mapGetters,

文件差異過大導致無法顯示
+ 2 - 2
dist/vuex.min.js


部分文件因文件數量過多而無法顯示