From 7ea7f2b84698bf44d3c676031a6d5c561ba27f4c Mon Sep 17 00:00:00 2001 From: Ivan Carosati Date: Thu, 1 Feb 2018 11:44:25 -0500 Subject: [PATCH] Removed all references of window.JSON. --- src/jschannel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jschannel.js b/src/jschannel.js index a4f6ba22..cb57eb51 100644 --- a/src/jschannel.js +++ b/src/jschannel.js @@ -230,7 +230,7 @@ /* browser capabilities check */ if (!window.postMessage) throw("jschannel cannot run this browser, no postMessage"); - if (!window.JSON || !window.JSON.stringify || ! window.JSON.parse) { + if (!JSON || !JSON.stringify || ! JSON.parse) { throw("jschannel cannot run this browser, no JSON parsing/serialization"); } @@ -551,7 +551,7 @@ throw "params cannot be a recursive data structure" } seen.push(obj); - + if (typeof obj === 'object') { for (var k in obj) { if (!obj.hasOwnProperty(k)) continue;