[OpenSRF-GIT] OpenSRF branch master updated. 04558f38c1c1d314acb978a37193dacb4a6eba31

Evergreen Git git at git.evergreen-ils.org
Fri Feb 3 12:12:56 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".

The branch, master has been updated
       via  04558f38c1c1d314acb978a37193dacb4a6eba31 (commit)
      from  89f41c82798dbac56716fdd5beeb6c0de3e4ce2e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 04558f38c1c1d314acb978a37193dacb4a6eba31
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Fri Jan 27 09:05:07 2012 -0500

    JSON_v0 has been superseded, and it has insidious bugs anyway.
    
    For example, you cannot round-trip this through JSON2js() and js2JSON()
    in IE8: http://paste.lisp.org/display/127338
    
    This will make Evergreen's build fail until the change specified in
    LP #922609 is applied.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/src/Makefile.am b/src/Makefile.am
index 74227f6..1b77959 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,7 +36,7 @@ endif
 if INSTALLJAVASCRIPT
 MAYBE_JAVASCRIPT = javascript
 jsdir = $(prefix)/lib/javascript
-js_SCRIPTS = javascript/DojoSRF.js javascript/JSON_v0.js javascript/JSON_v1.js javascript/md5.js javascript/opensrf.js javascript/opensrf_xhr.js javascript/opensrf_xmpp.js
+js_SCRIPTS = javascript/DojoSRF.js javascript/JSON_v1.js javascript/md5.js javascript/opensrf.js javascript/opensrf_xhr.js javascript/opensrf_xmpp.js
 endif
 
 if BUILDCORE
diff --git a/src/javascript/JSON_v0.js b/src/javascript/JSON_v0.js
deleted file mode 100644
index f0e0971..0000000
--- a/src/javascript/JSON_v0.js
+++ /dev/null
@@ -1,135 +0,0 @@
-// in case we run on an implimentation that doesn't have "undefined";
-var undefined;
-
-function Cast (obj, class_constructor) {
-    try {
-        if (eval(class_constructor + '["_isfieldmapper"]')) {
-            obj = eval("new " + class_constructor + "(obj)");
-        }
-    } catch( E ) {
-        alert( E + "\n");
-    } finally {
-        return obj;
-    }
-}
-
-function JSON2js (json) {
-
-    json = String(json).replace( /\/\*--\s*S\w*?\s*?\s+\w+\s*--\*\//g, 'Cast(');
-    json = String(json).replace( /\/\*--\s*E\w*?\s*?\s+(\w+)\s*--\*\//g, ', "$1")');
-
-    var obj;
-    if (json != '') {
-        try {
-            eval( 'obj = ' + json );
-        } catch(E) {
-            debug("Error building JSON object with string " + E + "\nString:\n" + json );
-            return null;
-        }
-    }
-    return obj;
-}
-
-
-function object2Array(obj) {
-    if( obj == null ) return null;
-
-    var arr = [];
-    for( var i  = 0; i < obj.length; i++ ) {
-        arr[i] = obj[i];
-    }
-    return arr;
-}
-
-
-function js2JSON(arg) {
-    return _js2JSON(arg);
-}
-
-function _js2JSON(arg) {
-    var i, o, u, v;
-
-        switch (typeof arg) {
-            case 'object':
-    
-                if(arg) {
-    
-                    if (arg._isfieldmapper) { /* magi-c-ast for fieldmapper objects */
-    
-                        if( arg.a.constructor != Array ) {
-                            var arr = []; 
-                            for( var i  = 0; i < arg.a.length; i++ ) {
-                                if( arg.a[i] == null ) {
-                                    arr[i] = null; continue;
-                                }
-    
-                                if( typeof arg.a[i] != 'object' ) { 
-                                    arr[i] = arg.a[i];
-    
-                                } else if( typeof arg.a[i] == 'object' 
-                                            && arg.a[i]._isfieldmapper) {
-    
-                                    arr[i] = arg.a[i];
-    
-                                } else {
-                                    arr[i] = object2Array(arg.a[i]);        
-                                }
-                            }
-                            arg.a = arr;
-                        }
-    
-                        return "/*--S " + arg.classname + " --*/" + js2JSON(arg.a) + "/*--E " + arg.classname + " --*/";
-    
-                    } else {
-    
-                        if (arg.constructor == Array) {
-                            o = '';
-                            for (i = 0; i < arg.length; ++i) {
-                                v = js2JSON(arg[i]);
-                                if (o) {
-                                    o += ',';
-                                }
-                                if (v !== u) {
-                                    o += v;
-                                } else {
-                                    o += 'null';
-                                }
-                            }
-                            return '[' + o + ']';
-    
-                        } else if (typeof arg.toString != 'undefined') {
-                            o = '';
-                            for (i in arg) {
-                                v = js2JSON(arg[i]);
-                                if (v !== u) {
-                                    if (o) {
-                                        o += ',';
-                                    }
-                                    o += js2JSON(i) + ':' + v;
-                                }
-                            }
-    
-                            o = '{' + o + '}';
-                            return o;
-    
-                        } else {
-                            return;
-                        }
-                    }
-                }
-                return 'null';
-    
-            case 'unknown':
-            case 'number':
-                return arg;
-    
-            case 'undefined':
-            case 'function':
-                return u;
-    
-            case 'string':
-            default:
-                return '"' + String(arg).replace(/(["\\])/g, '\\$1') + '"';
-        }
-
-}

-----------------------------------------------------------------------

Summary of changes:
 src/Makefile.am           |    2 +-
 src/javascript/JSON_v0.js |  135 ---------------------------------------------
 2 files changed, 1 insertions(+), 136 deletions(-)
 delete mode 100644 src/javascript/JSON_v0.js


hooks/post-receive
-- 
OpenSRF


More information about the opensrf-commits mailing list