Is there a way to find out if the function I wrote is overwritten or redefined? For example, let's say a guy named Jack has a function below:
// Jack function on team 1 function doSomething() { // doing things }
and one day he learns that a teammate at the north pole of the planet Zaksson used the same function name:
// Zaxar function on team 2 function doSomething() { // doing something else }
As you can see, Saxxar and Jack use the same function name. Neither Saxar nor John discovered the problem until 6 months in the project. They know that they can put a warning in their function and check it at runtime, but let Zaxar and Jack have 2 trillion functions, and they use 1 million JavaScript libraries, and they understand that it is not practical to place warnings in each function.
Is there a way to help Sachsar and Jack find out if there are any name conflicts at run time? Or is there a parameter that tells the JavaScript engine to cause name collision errors?
Additional Information
I load several libraries, and I think one of them uses the same function name as I do. So in this example, there really is no other developer with whom I can correlate. It discovers that the library (s) I am loading into uses the same function names and prevents something like this from happening along the line.
source share