Code Analysis in javascript not highlighting errors

2 posts, 0 answers
  1. Anil Baviskar
    Anil Baviskar avatar
    1 posts
    Member since:
    Dec 2009

    Posted 09 Dec 2009 Link to this post

    Hi,

    I installed JustCode beta & tried to test on some javascript.

    I twisted javascript to create code that will give me errors:

    The bold part in the code is modified to create errors.

    The code is:


    function Fev_FocusOnFirstFocusableElement(objForm123)
    {
        if (objForm && (objForm != null))
        {
            for (i = 0; i < objForm.length1; i++)
            {
                var objElement = objForm.elements[i];
                if (Fev_IsFocusableElement(objElement))
                {
                    objElement.focus();
                    return true;
                }
            }
        }
        return false;
    }

    But JustCode didn't highlighted error. Is it by design or limitations in JustCode.

    Screen shot attached for your reference:
  2. Jordan
    Admin
    Jordan avatar
    123 posts

    Posted 09 Dec 2009 Link to this post

    Hi Anil Baviskar,

    Thanks for the involvement. We does not show errors in this case because it can be a valid java scirpt code. You can define the variable objForm outside the function and it will be available in the function.

     

    var objForm = 5;
    objForm.length1 = 4;
     
    function Fev_FocusOnFirstFocusableElement(objForm123) {
        alert("test");
        alert(objForm);
        if (objForm && (objForm != null)) {
                 for (i = 0; i < objForm.length1; i++) {
                     alert("test");
                     var objElement = objForm.elements[i];
                     alert(objElement);
                     if (Fev_IsFocusableElement(objElement)) {
                         objElement.focus();
                         return true;
                     }
                 }
             }
             return false;
    }

     

    Greetings,
    Jordan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
Back to Top