浏览代码

Merge pull request #6861 from wenzhixin/fix/6844

Fixed maximum call stack size exceeded error
飞鱼 2 年之前
父节点
当前提交
78dd5fafc5
共有 2 个文件被更改,包括 17 次插入1 次删除
  1. 6 0
      CHANGELOG.md
  2. 11 1
      src/utils/index.js

+ 6 - 0
CHANGELOG.md

@@ -1,6 +1,12 @@
 ChangeLog
 ChangeLog
 ---------
 ---------
 
 
+### 1.22.1
+
+#### Core
+
+- **Update:** Fixed maximum call stack size exceeded error.
+
 ### 1.22.0
 ### 1.22.0
 
 
 #### Core
 #### Core

+ 11 - 1
src/utils/index.js

@@ -212,7 +212,17 @@ export default {
   },
   },
 
 
   isObject (obj) {
   isObject (obj) {
-    return typeof obj === 'object' && obj !== null && !Array.isArray(obj)
+    if (typeof obj !== 'object' || obj === null) {
+      return false
+    }
+
+    let proto = obj
+
+    while (Object.getPrototypeOf(proto) !== null) {
+      proto = Object.getPrototypeOf(proto)
+    }
+
+    return Object.getPrototypeOf(obj) === proto
   },
   },
 
 
   isEmptyObject (obj = {}) {
   isEmptyObject (obj = {}) {