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 231531 - Mark occurrences and navigation doesn't work correctly, when is used definition via prototype
Summary: Mark occurrences and navigation doesn't work correctly, when is used definiti...
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks: 217992
  Show dependency tree
 
Reported: 2013-06-19 15:09 UTC by Petr Pisl
Modified: 2013-06-21 02:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2013-06-19 15:09:18 UTC
it("case2: prototype inheritance", function() {
    var Animal = function() {
    };
    Animal.prototype.roar = function() {
        return 'rrrr';
    };

    var animal = new Animal();
    var grrr = animal.roar(); // here it works            

    var Cat = function() {
    };

    Cat.prototype = new Animal();
    Cat.prototype.mieow = function() {
        return 'mieow';
    };

    var cat = new Cat();
    expect(cat.roar()).toEqual('rrrr'); // ctr+click does not work on roar
});
Comment 1 Petr Pisl 2013-06-19 15:54:14 UTC
The problem is that normally the occurrences are moved during resolving types in the first phase, but in this phase the prototype chain is not resolved, so we are not able to identify usage of the roar method from Animal object.
Comment 2 Petr Pisl 2013-06-20 11:52:58 UTC
Fixed in web-main:
http://hg.netbeans.org/web-main/rev/6e09cae84aa3
Comment 3 Quality Engineering 2013-06-21 02:30:30 UTC
Integrated into 'main-golden', will be available in build *201306202301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6e09cae84aa3
User: Petr Pisl <ppisl@netbeans.org>
Log: #231531 - Mark occurrences and navigation doesn't work correctly, when is used definition via prototype