diff --git a/json.js b/json.js old mode 100755 new mode 100644 index 1c2b253..9a338bf --- a/json.js +++ b/json.js @@ -1,6 +1,6 @@ /* json.js - 2011-08-30 + 2012-10-08 Public Domain @@ -196,8 +196,7 @@ // Create a JSON object only if one does not already exist. We create the // methods in a closure to avoid creating global variables. -var JSON; -if (!JSON) { +if (typeof JSON !== 'object') { JSON = {}; } diff --git a/json2.js b/json2.js index 3b0c872..c7745df 100644 --- a/json2.js +++ b/json2.js @@ -1,6 +1,6 @@ /* json2.js - 2011-10-19 + 2012-10-08 Public Domain. @@ -159,8 +159,7 @@ // Create a JSON object only if one does not already exist. We create the // methods in a closure to avoid creating global variables. -var JSON; -if (!JSON) { +if (typeof JSON !== 'object') { JSON = {}; }