[Pkg-javascript-commits] [json-js] 40/85: style

Jonas Smedegaard dr at jones.dk
Mon Mar 14 10:39:16 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 42c18c621a411c3f39a81bb0a387fc50dcd738d9
Author: Douglas Crockford <douglas at crockford.com>
Date:   Thu Jun 21 16:34:13 2012 -0700

    style
---
 json_parse.js | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 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;
     };
 }());

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