You found a bug! We've classified it as EXTJS-10547 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Sep 2009
    Location
    Denver
    Posts
    51
    Vote Rating
    2
    McQuack_82 will become famous soon enough

      0  

    Default Ext.Json.encode not passing all argument to native strinify

    Ext.Json.encode not passing all argument to native strinify


    The 2nd and 3rd optional argument don't appear to be passed to native stringify method.

    Code:
    Ext.USE_NATIVE_JSON = true;
    
    Calling Ext.JSON.encode 
    
    console.log(Ext.JSON.encode({prop1: 'test1', prop2: 'test2',}, null, 4)); 
    
    
    {"prop1":"test1","prop2":"test2"}
    
    
    Calling JSON.stringify dirrectly
    
    console.log(JSON.stringify({prop1: 'test1', prop2: 'test2',}, null, 4)); 
    
    
    {
        "prop1": "test1",
        "prop2": "test2"
    }
    *EDIT
    Additional notes from McQuack_82:
    Code:
    me.encode = function(object, replacer, space) {
        if (!encodingFunction) {
            // setup encoding function on first access
            encodingFunction = isNative() ? JSON.stringify : me.encodeValue;
        }
        return encodingFunction(arguments);
    };
    https://developer.mozilla.org/en-US/...JSON/stringify

  2. #2
    Sencha User
    Join Date
    Sep 2009
    Location
    Denver
    Posts
    51
    Vote Rating
    2
    McQuack_82 will become famous soon enough

      0  

    Default I think the code in encode needs changed to following

    I think the code in encode needs changed to following


    Code:
    me.encode = function(object, replacer, space) {
    	if (!encodingFunction) {
    		// setup encoding function on first access
    		encodingFunction = isNative() ? JSON.stringify : me.encodeValue;
    	}
    	return encodingFunction(arguments);
    };
    https://developer.mozilla.org/en-US/...JSON/stringify

  3. #3
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,062
    Vote Rating
    215
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  4. #4
    Sencha - QA Team ryansmith's Avatar
    Join Date
    Oct 2012
    Location
    Lawrence, KS
    Posts
    2
    Vote Rating
    0
    ryansmith is on a distinguished road

      0  

    Default


    Hi McQuack_82

    Can you tell us what version of ExtJS your using?

    Thanks

  5. #5
    Sencha User
    Join Date
    Sep 2009
    Location
    Denver
    Posts
    51
    Vote Rating
    2
    McQuack_82 will become famous soon enough

      0  

    Default version in test case

    version in test case


    the version in the test case extjs 4.1.1 gpl

Thread Participants: 2

Tags for this Thread