Skip to content

Commit 8d11dc6

Browse files
Create a JSON object only if one does not already exist.
1 parent 11c7bdf commit 8d11dc6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

json.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
json.js
3-
2010-11-18
3+
2010-12-08
44
55
Public Domain
66
@@ -193,6 +193,13 @@
193193
*/
194194

195195

196+
// Create a JSON object only if one does not already exist. We create the
197+
// methods in a closure to avoid creating global variables.
198+
199+
if (!this.JSON) {
200+
this.JSON = {};
201+
}
202+
196203
(function () {
197204
"use strict";
198205

0 commit comments

Comments
 (0)