Results 1 to 3 of 3

Thread: [4.1 RC 3] - Ext.iterate has a BUG

    You found a bug! We've classified it as EXTJS-6108 . 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
    Apr 2007
    Posts
    10
    Vote Rating
    0
      0  

    Default [4.1 RC 3] - Ext.iterate has a BUG

    PHP Code:
    var = {
    name:"test" 
    length"l1"
    }
    Ext.iterate(, function(k){
    .....
    }) 
    is wrong ......

    --------------
    if (Ext.isIterable(object)) {
    Ext.Array.each.call(Ext.Array, object, fn, scope);
    }
    else {
    Ext.Object.each.call(Ext.Object, object, fn, scope);
    }
    --------------

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      0  

    Default

    I'm going to open as a bug.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    31
    Vote Rating
    2
      0  

    Default

    Bug still exists in ExtJS 4.2.0.663

    The function should look like this to do not fail for objects containing a key called 'length'.

    Code:
    iterate: function(object, fn, scope) {
                if (Ext.isEmpty(object)) {
                    return;
                }
    
    
                if (scope === undefined) {
                    scope = object;
                }
    
    
                if (Ext.isArray(object)) {
                    Ext.Array.each.call(Ext.Array, object, fn, scope);
                }
                else {
                    Ext.Object.each.call(Ext.Object, object, fn, scope);
                }
            }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •