[JavaScript] FIxed issue where code completion got confused between same name function and variable, and threw exception trying to add overload of a function to a variable.