I think this probably does not work, because many methods in JavaScript define something ..
function foo() {}var foo = function() {};window.foo = function() {};window['foo'] = function() {};var z = 'foobar'; window[z.substr(0, 3)] = function() {};
In particular, the latter would - even if it was hardly ever used in real code - it is almost impossible to detect an IDE without executing all the code, and then keep track of where the global is defined for the first time.
Another example is libraries that implement a class system. Without knowing the details of each library, it is quite difficult to determine which class names they define.
source share