From a8c7c876366f5edf848f1e6318688f441c7b646b Mon Sep 17 00:00:00 2001 From: Tony Rossi Date: Tue, 13 Oct 2015 15:05:24 -0400 Subject: [PATCH] Add check for Object.isFrozen() in isPojo() 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. --- src/utils/functions.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/functions.js b/src/utils/functions.js index e974588d..7a4450c8 100644 --- a/src/utils/functions.js +++ b/src/utils/functions.js @@ -8,6 +8,8 @@ export function isPojo(target) { && typeof target === 'object' && + !Object.isFrozen(target) + && Object.prototype.toString.call(target) === '[object Object]' && isFunction(Ctor)