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 238863 - Wrong variable value tooltips with nashorn
Summary: Wrong variable value tooltips with nashorn
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-27 09:33 UTC by Vladimir Riha
Modified: 2014-01-13 08:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
another case (1.89 KB, application/javascript)
2013-12-12 15:14 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2013-11-27 09:33:03 UTC
Please try to create new Java project, add JS file with following content:

function test(){
    var a =1;
   return 3; // line breakpoint here
}

test();


 - add line breakpoint 
 - debug file
 - when debugging is paused, hover over "a"

=> tooltip says

"a = >Missing scope<"




Product Version: NetBeans IDE Dev (Build 201311270002)
Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b59
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b117
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2013-11-27 09:42:01 UTC
It seems like tooltips in general are showing wrong information:

 - Tooltip shows #NUMBER for "global" variables


var a = 1;
function test(){
   
   return a;
}

var b = test();

var c = 1; // line breakpoint here

=> tooltip for b and a shows e.g. #1325 as value of "a"



================================


var a = 1;
function test(){
   var ale = 1;
   return a; // line breakpoint here
}

var b = test();

var c = 1;


=> tooltip says value of "ale" is null



In all cases, Variables window shows correct data
Comment 2 Martin Entlicher 2013-11-27 12:31:26 UTC
This was already partly fixed by http://hg.netbeans.org/main-silver/rev/15b40f9e6641 but some cases still remain...
Comment 3 Vladimir Riha 2013-11-27 17:03:52 UTC
Martine, will the fix also cover similar issue with Evaluate expression (should it be supported in this debugging)? Right now it seems to evaluate similarly wrong value as the tooltip.
Comment 4 Vladimir Riha 2013-12-12 15:14:27 UTC
Created attachment 143106 [details]
another case

To be thorough, another case. Add breakpoint to line 19 ("this.name = name") and debug file
 -> once debugger stops on the line, hover over "name" in line 17
=> tooltip shows "name = null"


Product Version: NetBeans IDE Dev (Build 201312120002)
Comment 5 Martin Entlicher 2014-01-09 17:00:48 UTC
Fixed by changeset:   270299:c38f19d66ff1
http://hg.netbeans.org/core-main/rev/c38f19d66ff1
Comment 6 Vladimir Riha 2014-01-13 08:43:31 UTC
Verified, thank you


Product Version: NetBeans IDE Dev (Build 201401130002)
Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b65
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b122
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)