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 224796 - Internal object incorrectly shown in navigator
Summary: Internal object incorrectly shown in navigator
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 7.2.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-12 19:20 UTC by Xypron
Modified: 2015-05-23 08:01 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
current (actual.png) and expected (expected.png) display (123.44 KB, application/gzip)
2013-01-12 19:20 UTC, Xypron
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xypron 2013-01-12 19:20:58 UTC
Created attachment 130144 [details]
current (actual.png) and expected (expected.png) display

Dear maintainer,

given 

    function App(appDiv) {
        var app = new xWipe.Pagelet(appDiv);

        app.resize = function() {
        // put method body here
        };
        
        return app;
    }

object app is shown outside of the context of App in the navigator:
C App
|-c App(appDiv):App
C app
|-m resize:void

It should be shown in the context of App, e.g.
C App
|-c App(appDiv):App
| C app
| |-m resize:void


In the appendices find the current (actual.png) and the expected
(expected.png) behavior as screen shots.

Best regards

Heinrich Schuchardt
Comment 1 Vladimir Riha 2013-01-12 19:36:44 UTC
Thanks for reporting. In Dev builds app is not listed in Navigator unless you indicate that App is a "class", for instance using JSDoc,this keyword or declare some inner (private) function:


   /**
    * @class
    * @param {type} appDiv
    * @returns {App.app}
    */
   function App(appDiv) {
        var app = new xWipe.Pagelet(appDiv);

        app.resize = function() {
        // put method body here
        };
        
        function test(){};

        return app;
    }

And then it works as you expected, it is "under" the App. I'm not sure if it should display it in your case. You can download latest Dev build to try it from 

http://bits.netbeans.org/netbeans/trunk
Comment 2 Xypron 2013-01-12 21:51:43 UTC
Thank you for you hint concerning JsDoc comments.

I just installed netbeans-dev-201301120001.

Unfortunately the navigator of this release seems to be have errors too.

It shows neither App nor app nor resize for

(function(window) {
    "use strict";
    var xWipe = window.xWipe;
    if (!xWipe) {
        xWipe = {
            types : {}
        };
        window.xWipe = xWipe;
    }

    /**
     * @class
     * @param {type} appDiv
     * @returns {App.app}
     */
    function App(appDiv) {
        var app = new xWipe.Pagelet(appDiv);

        app.resize = function() {
            // put method body here
        };

        return app;
    }
}(window));
Comment 3 Petr Pisl 2015-05-22 08:56:43 UTC
Working in dev builds. Adding test for it.
Comment 4 Quality Engineering 2015-05-23 08:01:23 UTC
Integrated into 'main-silver', will be available in build *201505230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c3c5abf5e818
User: Petr Pisl <ppisl@netbeans.org>
Log: #224796 - Internal object incorrectly shown in navigator