Skip to content

Commit

Permalink
fix: detect polyfilled Map & Set objects, closes vuejs#744
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau authored and iksim committed Apr 18, 2019
1 parent 58c21ba commit 0e9548f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ function replacer (key) {
} else if (type === 'symbol') {
return `[native Symbol ${Symbol.prototype.toString.call(val)}]`
} else if (val !== null && type === 'object') {
if (val instanceof Map) {
if (val instanceof Map || val.toString() === '[object Map]') {
return encodeCache.cache(val, () => getCustomMapDetails(val))
} else if (val instanceof Set) {
} else if (val instanceof Set || val.toString() === '[object Set]') {
return encodeCache.cache(val, () => getCustomSetDetails(val))
} else if (val instanceof RegExp) {
// special handling of native type
Expand Down

0 comments on commit 0e9548f

Please sign in to comment.