douglascrockford/JSON-js — Issue #22: !JSON check in json2.js?
Author: Jimgskoop
Created: 2011-12-23 00:33:15+00:00
State: open

Per the comment in json2.js

// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.

Shouldn't the check

var JSON;
if (!JSON) {
JSON = {};
}

instead be

if (!window.JSON) {
window.JSON = {};
}

???