Skip to content

Commit

Permalink
Add check for Object.isFrozen() in isPojo()
Browse files Browse the repository at this point in the history
This adds support for seamless-immutable.js which freezes property fields.  Without this change StateFunctions.js will attempt to delete frozen keys and throws an error.  Simple check for with Object.isFrozen() enables alt.bootstrap({}) to work with seamless-immutable.
  • Loading branch information
tony99nyr committed Oct 13, 2015
1 parent 57c0776 commit a8c7c87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export function isPojo(target) {
&&
typeof target === 'object'
&&
!Object.isFrozen(target)
&&
Object.prototype.toString.call(target) === '[object Object]'
&&
isFunction(Ctor)
Expand Down

0 comments on commit a8c7c87

Please sign in to comment.