This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 246299

Summary: Go to declaration doesn't work in some cases
Product: javascript Reporter: Petr Pisl <ppisl>
Component: EditorAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Petr Pisl 2014-08-06 11:10:44 UTC
Have a code:

var myModule = function()
{
    return {
        foo: function()
        {
            console.log("foo");
        },
        bar: "bar"
    };
};

myModule().bar;
myModule().foo();

var yourModule = myModule();
yourModule.bar;
yourModule.foo();

Navigation from myModule().bar and myModule.foo doesn't work, but the navigation from yourModule.bar and yourModule.foo() works correctly.
Comment 1 Reema 2017-07-11 11:25:38 UTC
Investigated this, it's likely an issue with the way Model is created. Here myModule() invoke call is never getting resolved, as it is not appearing under top fileObject function's properties. We resolve the properties and arguments recursively for Model objects. 'yourModule' is one of the properties under top fileObject function, so it is resolved and occurence is getting added to the anonymous object in myModule function.