Skip to content

Commit

Permalink
Create a JSON object only if one does not already exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
douglascrockford committed Dec 8, 2010
1 parent 11c7bdf commit 8d11dc6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion json.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
json.js
2010-11-18
2010-12-08
Public Domain
Expand Down Expand Up @@ -193,6 +193,13 @@
*/


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

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

(function () {
"use strict";

Expand Down

0 comments on commit 8d11dc6

Please sign in to comment.