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.
Please try to - debug following JS code in Java project: function Humanoid(name) { this.name = name; this.numberOfLegs = 2; this.version = 0; this.die = function() { print(this.name + " died"); // line breakpoint here }; } var homoHabilis = new Humanoid("theFirstOne"); homoHabilis.die(); - add line breakpoint to the line with print() call - debug file - once debugger stops, do Evaluate expression for this.name => it is evaluated as type: Undefined, value: #1390 while it should be string with value of "theFirstOne". Tooltip and watch shows the same wrong value, but variable in Variables shows correct one. 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)
Created attachment 143883 [details] another case Please try to add breakpoint to line 96 and debug the attached file in JavaSE project. Once debugger stops, check following: => Move cursor over foo on line 93, tooltip shows value null, should be 1 => select 1+a on line 92, tooltip shows 1+a=null The same goes for New watch action. Again Variables window shows correct values for these variables.
This might be some issue with the Nashorn evaluator. In Variables I can see correct values, but evaluator returns undefined. :-(
*** Bug 250269 has been marked as a duplicate of this bug. ***
The evaluation of 'this.<something>' is fixed by changeset: 287176:855d82a1ab66 http://hg.netbeans.org/core-main/rev/855d82a1ab66 The problem with '1+a=null' is a very different problem, which is most likely in Nashorn itself and unfixable in NetBeans. I'll close this issue after I'll file a defect for Nashorn.
Issue https://bugs.openjdk.java.net/browse/JDK-8078525 is submitted for the problem with null evaluation result. In fact, message: ReferenceError: "a" is not defined is thrown as a result of the evaluation. This second part of the issue should be fixed in nashorn IMHO.
Integrated into 'main-silver', will be available in build *201504270341* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/855d82a1ab66 User: mentlicher@netbeans.org Log: #240395: Perform evaluation on the Context object and use directEval, which is necessary for correct interpretation of 'this'.