1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    27
    Vote Rating
    0
    Diavololt is on a distinguished road

      0  

    Default 4.1.1 Cannot convert object to null and LINT

    4.1.1 Cannot convert object to null and LINT


    Please, check with lint: ext-all*.js

    I have one problem with older computers:

    ext-all-debug.js Line: 39330

    prepareItems : function(items, applyDefaults) {
    //alert(items,applyDefaults);
    if (Ext.isArray(items)) {
    items = items.slice();
    } else {
    items = [items];
    }



    var me = this,
    i = 0,
    len = items.length,
    item;


    for (; i < len; i++) {
    item = items[i];
    if (item === null) {
    Ext.Array.erase(items, i, 1);
    --i;
    --len;
    } else {
    if (applyDefaults) {
    item = this.applyDefaults(item);
    }

    item.isContained = me;
    items[i] = me.lookupComponent(item);


    delete item.isContained;
    delete items[i].isContained;
    }
    }


    return items;
    }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,684
    Vote Rating
    435
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    JSLint is a tool that will catch many things but IMO, Crockford takes things too far. There is nothing invalid about using == in many cases.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    27
    Vote Rating
    0
    Diavololt is on a distinguished road

      0  

    Default


    for (; i < len; i++) {
    item = items[i];
    if (item == null) {
    Ext.Array.erase(items, i, 1);
    --i;
    --len;
    } else {
    if (applyDefaults) {
    item = this.applyDefaults(item);
    }


    // Tell the item we're in a container during construction
    item.isContained = me;
    items[i] = me.lookupComponent(item);
    // need to delete both in case item was a config
    delete item.isContained;
    delete items[i].isContained;
    Uncaught TypeError: Cannot convert null to object
    }
    }
    Some times i get this exception on big app. ext-all-dev.js:
    Uncaught TypeError: Cannot convert null to object ext-all-dev.js


    with no details.


    There is a Ext.List (extended) with cellclick listener with:


    Ext.suspendLayouts();
    Ext.create('Ext.ux.form.Panel',{ //extended form with initComponent .. this.callParent() ..)
    ...
    });
    Ext.resumeLayouts(true);


    This exception throwing 1 time in few days (60 - 150 clicks);