[Pkg-javascript-commits] [json-js] 53/85: Imported Upstream version 0~20121008

Jonas Smedegaard dr at jones.dk
Mon Mar 14 10:39:40 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 b5b65a44f4d3ae03a455c2dc0d8ae14f14f9a614
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Wed Nov 14 20:34:36 2012 +0100

    Imported Upstream version 0~20121008
---
 cycle.js | 28 +++++++++++++++++++++++-----
 json.js  |  5 ++---
 json2.js |  5 ++---
 3 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/cycle.js b/cycle.js
old mode 100755
new mode 100644
index 1ced7da..7187bf4
--- a/cycle.js
+++ b/cycle.js
@@ -1,5 +1,17 @@
-// cycle.js
-// 2011-08-24
+/*
+    cycle.js
+    2012-08-19
+
+    Public Domain.
+
+    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+    This code should be minified before deployment.
+    See http://javascript.crockford.com/jsmin.html
+
+    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+    NOT CONTROL.
+*/
 
 /*jslint evil: true, regexp: true */
 
@@ -42,9 +54,15 @@ if (typeof JSON.decycle !== 'function') {
             case 'object':
 
 // typeof null === 'object', so get out if this value is not really an object.
-
-                if (!value) {
-                    return null;
+// Also get out if it is a weird builtin object.
+
+                if (value === null ||
+                        value instanceof Boolean ||
+                        value instanceof Date    ||
+                        value instanceof Number  ||
+                        value instanceof RegExp  ||
+                        value instanceof String) {
+                    return value;
                 }
 
 // If the value is an object or array, look to see if we have already
diff --git a/json.js b/json.js
old mode 100755
new mode 100644
index 1c2b253..9a338bf
--- a/json.js
+++ b/json.js
@@ -1,6 +1,6 @@
 /*
     json.js
-    2011-08-30
+    2012-10-08
 
     Public Domain
 
@@ -196,8 +196,7 @@
 // Create a JSON object only if one does not already exist. We create the
 // methods in a closure to avoid creating global variables.
 
-var JSON;
-if (!JSON) {
+if (typeof JSON !== 'object') {
     JSON = {};
 }
 
diff --git a/json2.js b/json2.js
index 3b0c872..c7745df 100644
--- a/json2.js
+++ b/json2.js
@@ -1,6 +1,6 @@
 /*
     json2.js
-    2011-10-19
+    2012-10-08
 
     Public Domain.
 
@@ -159,8 +159,7 @@
 // Create a JSON object only if one does not already exist. We create the
 // methods in a closure to avoid creating global variables.
 
-var JSON;
-if (!JSON) {
+if (typeof JSON !== 'object') {
     JSON = {};
 }
 

-- 
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