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 214982 - Prototype coloring is inconsistent
Summary: Prototype coloring is inconsistent
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-29 11:42 UTC by Vladimir Riha
Modified: 2012-07-17 10:40 UTC (History)
1 user (show)

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 Vladimir Riha 2012-06-29 11:42:12 UTC
Use following snippet:

function Foo(){
    
    Foo.prototype.getA = function(){ return "A";};
    Foo.prototype.getB= function(){ return "B"; };
}

The second "call" of prototype property is not bold and the first one is. If the lines are changed like this:

function Foo(url, name){
    
    Foo.prototype.getA = function(){ return "A";};
    FooBar.prototype.getB= function(){ return "B"; };
}

Both "prototype" are bold


Product Version: NetBeans IDE 7.2 RC1 (Build 201206272359)
Java: 1.7.0_05; Java HotSpot(TM) Client VM 23.1-b03
System: Linux version 3.0.0-21-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2012-07-10 11:51:13 UTC
Another case:

function A()                        
{
    this.x = 1;
    this.x = 1;
    
}

A.prototype.inc = function()        
{
    this.x += 1;
}


The variable "x" in function A() is green, while in A.prototype.inc it is black
Comment 2 Petr Pisl 2012-07-10 13:52:47 UTC
These are two different issues. The case with prototype is not a bug basically. It's intended. In the line with Foo.prototype.getA is prototype bold, because it's basically definition of the prototype object. On the line with Foo.prototype.getB is not bold, because it's the usage of the object. Probably I will change the strategy and the bold will be only objects that are really created though assignment to a literal object or new expression.

The second case with this.x is a different issue. I'm going separate it.
Comment 3 Petr Pisl 2012-07-10 13:54:57 UTC
For the second part I created new issue #215354
Comment 4 Vladimir Riha 2012-07-10 14:15:48 UTC
ok, thanks
Comment 5 Petr Pisl 2012-07-13 09:12:46 UTC
Fixed in web main.
Comment 6 Quality Engineering 2012-07-17 03:04:38 UTC
Integrated into 'main-golden', will be available in build *201207170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ea7ea6357beb
User: Petr Pisl <ppisl@netbeans.org>
Log: #214982 - Prototype coloring is inconsistent
Comment 7 Vladimir Riha 2012-07-17 10:40:56 UTC
verified, thanks

Product Version: NetBeans IDE Dev (Build 201207170002)
Java: 1.7.0_06-ea; Java HotSpot(TM) Client VM 23.2-b08
System: Linux version 3.0.0-21-generic-pae running on i386; UTF-8; en_US (nb)