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

Jonas Smedegaard dr at jones.dk
Mon Mar 14 10:39:17 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 965168f3e1294badacd42c670d1cdd8b8e466e4d
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Fri Jun 22 21:28:36 2012 +0200

    Imported Upstream version 0~20120621
---
 json_parse.js       | 33 ++++++++++++++++++---------------
 json_parse_state.js |  4 ++--
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/json_parse.js b/json_parse.js
index 80affa9..89b8b77 100644
--- a/json_parse.js
+++ b/json_parse.js
@@ -1,6 +1,6 @@
 /*
     json_parse.js
-    2011-03-06
+    2012-06-20
 
     Public Domain.
 
@@ -160,7 +160,8 @@ var json_parse = (function () {
                     if (ch === '"') {
                         next();
                         return string;
-                    } else if (ch === '\\') {
+                    }
+                    if (ch === '\\') {
                         next();
                         if (ch === 'u') {
                             uffff = 0;
@@ -326,21 +327,23 @@ var json_parse = (function () {
 // in an empty key. If there is not a reviver function, we simply return the
 // result.
 
-        return typeof reviver === 'function' ? (function walk(holder, key) {
-            var k, v, value = holder[key];
-            if (value && typeof value === 'object') {
-                for (k in value) {
-                    if (Object.prototype.hasOwnProperty.call(value, k)) {
-                        v = walk(value, k);
-                        if (v !== undefined) {
-                            value[k] = v;
-                        } else {
-                            delete value[k];
+        return typeof reviver === 'function'
+            ? (function walk(holder, key) {
+                var k, v, value = holder[key];
+                if (value && typeof value === 'object') {
+                    for (k in value) {
+                        if (Object.prototype.hasOwnProperty.call(value, k)) {
+                            v = walk(value, k);
+                            if (v !== undefined) {
+                                value[k] = v;
+                            } else {
+                                delete value[k];
+                            }
                         }
                     }
                 }
-            }
-            return reviver.call(holder, key, value);
-        }({'': result}, '')) : result;
+                return reviver.call(holder, key, value);
+            }({'': result}, ''))
+            : result;
     };
 }());
diff --git a/json_parse_state.js b/json_parse_state.js
index 2153fbe..142229f 100644
--- a/json_parse_state.js
+++ b/json_parse_state.js
@@ -1,6 +1,6 @@
 /*
     json_parse_state.js
-    2011-02-23
+    2012-06-01
 
     Public Domain.
 
@@ -325,7 +325,7 @@ var json_parse = (function () {
 //  r[0] contains everything that matched, including any initial whitespace.
 //  r[1] contains any punctuation that was matched, or true, false, or null.
 //  r[2] contains a matched number, still in string form.
-//  r[3] contains a matched string, without quotes but with ecapement.
+//  r[3] contains a matched string, without quotes but with escapement.
 
                 if (r[1]) {
 

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