This is a migrated thread and some comments may be shown as answers.

Code Analysis in javascript not highlighting errors

1 Answer 65 Views
Code Analysis
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anil Baviskar
Top achievements
Rank 1
Anil Baviskar asked on 09 Dec 2009, 08:05 AM
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:

1 Answer, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 09 Dec 2009, 10:14 AM
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.
Tags
Code Analysis
Asked by
Anil Baviskar
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Share this question
or