[Pkg-javascript-commits] [json-js] 02/85: Create a JSON object only if one does not already exist.

Jonas Smedegaard dr at jones.dk
Mon Mar 14 10:39:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository json-js.

commit 8d11dc6950eafc7d01f141ce91d4f585caa29f3b
Author: Douglas Crockford <douglas at crockford.com>
Date:   Wed Dec 8 01:24:13 2010 -0800

    Create a JSON object only if one does not already exist.
---
 json.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/json.js b/json.js
index 15ebda6..ea2377f 100755
--- a/json.js
+++ b/json.js
@@ -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";
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/json-js.git



More information about the Pkg-javascript-commits mailing list