Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext JS Premium Member
    Join Date
    Feb 2009
    Posts
    57
    Vote Rating
    0
    papandreou is on a distinguished road

      0  

    Default Unanswered: 183 bytes can be saved in JSON.js

    Unanswered: 183 bytes can be saved in JSON.js


    I provided a patch for saving 183 bytes in JSON.js here: http://www.extjs.com/forum/showthrea...375#post352375

    However, nobody noticed because I posted after the thread had been marked as FIXED. Mystix recommended that I start a new thread, so that's what I'm doing now .

    Best regards,
    Papandreou
    Last edited by papandreou; 11 Nov 2009 at 11:09 AM. Reason: typo

  2. #2
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Answers
    9
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Thumbs up


    How about we actually implement the 'safe' option, too ?

    As proposed:
    Code:
     /**
         * Decodes (parses) a JSON string to an object. If the JSON is invalid, this function throws a SyntaxError unless the safe option is set.
         * @param {String} json The JSON string
         * @return {Object} The resulting object
         */
        this.decode = function(o) {
            var decoder = Ext.USE_NATIVE_JSON && nativeJSONAvailable ? JSON.parse : doDecode;
            
            if(!!safe){
                  var obj = null;
                  try{ obj = decoder(json); } catch(je){}
                  finally { return obj; }
            }else {
                  return decoder(json);
            }
             };
    }()
    
    or, as the current closure [SVN]:
    Code:
           /**
             * Decodes (parses) a JSON string to an object. If the JSON is invalid, this function throws a SyntaxError unless the safe option is set.
             * @param {String} json The JSON string
             * @return {Object} The resulting object
             */
            this.decode = function() {
                var dc;
                return function(json, safe) {
                    if (!dc) {
                        // setup decoding function on first access
                        dc = isNative() ? JSON.parse : doDecode;
                    }
                    
                    if(!!safe){
                        var obj = null;
                        try{ obj = dc(json); } catch(je){}
                        finally { return obj; }
                    }else {
                        return dc(json);
                    }
                    
                };
            }()
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2009
    Posts
    57
    Vote Rating
    0
    papandreou is on a distinguished road

      0  

    Default


    Quote Originally Posted by hendricd View Post
    How about we actually implement the 'safe' option, too ?
    Seems like a topic for a separate thread

    Code:
    if(!!safe){
    If your patch is accepted, I propose that we save another two bytes by omitting the two nots. Semantically the above code is exactly identical to if(safe) {... I realize why you'd sometimes want to use that trick to force a value to be converted to boolean, but here you're just asking about the truth value.

    Best regards,
    Papandreou

  4. #4
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Answers
    9
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Agreed, dbl-negation optional.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  5. #5
    Sencha User
    Join Date
    Apr 2008
    Posts
    99
    Vote Rating
    0
    Bulle Bas is on a distinguished road

      0  

    Default


    how can
    Code:
    if(!!safe)
    be different from
    Code:
    if (safe)
    ?

    I think the boolean cast will happen anyhow? No?

Thread Participants: 2