Browse Source

Merge pull request #6861 from wenzhixin/fix/6844

Fixed maximum call stack size exceeded error
飞鱼 2 years ago
parent
commit
78dd5fafc5
2 changed files with 17 additions and 1 deletions
  1. 6 0
      CHANGELOG.md
  2. 11 1
      src/utils/index.js

+ 6 - 0
CHANGELOG.md

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

+ 11 - 1
src/utils/index.js

@@ -212,7 +212,17 @@ export default {
   },
 
   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 = {}) {