Create a JSON object only if one does not already exist.

This commit is contained in:
Douglas Crockford 2010-12-08 01:24:13 -08:00
parent 11c7bdf47c
commit 8d11dc6950

View file

@ -1,6 +1,6 @@
/*
json.js
2010-11-18
2010-12-08
Public Domain
@ -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";