Java script resolution of function calls Follow
Hello,
For example, consider the code below:
function hello1() {
console.log("hello1");
}
var lib2 = function(context) {
context.hello2 = function() {
console.log("hello2");
};
};
var lib3 = function(context) {
context.hello3 = function() {
console.log("hello3");
};
};
function main() {
var importedLib = {};
lib2(importedLib);
lib3(this);
hello1(); // resolved
importedLib.hello2(); // resolved
hello3(); // not resolved
}
For "hello1()" and "hello2()" IntelliJ will find their usages. However, calling "hello3()" without specifying "this" or some other object is not resolved.
Is there a way to fix this?
Thank you,
Dmitry
Please sign in to leave a comment.
Hello Dmitry,
WebStorm can't handle such dynamic bindings, but as a workaround you can use @name tag. This way hello3 will be resolved both from global context and after qualifier:
Thank you. This does help with resolution from function invocation.
However, the function call is still not searchable from its declaration: