Javascript - wrong Codeinspection - wrong function is shown...


I thing it's a bug - or maybe I'm wrong.

I have three files:

1. index.php:
     only html and JavaScript.
     have the lines

          fileObj = new FuncFileOne();

     The last line ( fileObj.firstfunction();) should produce an errormsg - because the function don't exist.

2. Javascript File with Function "FuncFileOne" - and a prototye firstfunction2
2. Javascript File with Function "FuncFileTwo" - and a prototye firstfunction

Here is the Code:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<html lang="en">
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="inc/css/main.css" media="all">

    <script type="text/javascript" src="/inc/scripts/js/jquery/jquery-latest.js"></script>
    <script type="text/javascript" src="/inc/scripts/fileOne.js"></script>

    <script type="text/javascript">

        var fileObj;

            fileObj = new FuncFileOne();

            fileObj.firstfunction(); // should show an error?!?


<body >

<div id="testid">




function FuncFileOne(){


FuncFileOne.prototype.firstfunction2 = function(){ // this function is not called, because it has a wrong name
  alert('its from file one');


function FuncFileTwo(){


FuncFileTwo.prototype.firstfunction = function(){
  alert('its from file twoe');


The big problem is, that when I make CTRL+Click on the word "firstfunction", the IDE goes to the function in FuncFileTwo without warning. (I think, it should say "function not found" - or something like that.

Yesterday I worked on an larger Projekt, And I didn't realized, that I was working on the wrong part (same functionname in an different file - the function i wanted to edit was not created)

Please sign in to leave a comment.