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 140834 - Expression Evaluation upon Hovering
Summary: Expression Evaluation upon Hovering
Status: RESOLVED WONTFIX
Alias: None
Product: javascript
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P2 blocker (vote)
Assignee: _ deva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-18 22:04 UTC by Joelle Lam
Modified: 2012-09-03 08:31 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joelle Lam 2008-07-18 22:04:42 UTC
Fix Expression Evaluation upon Hovering
Comment 1 _ sandipchitale 2008-07-19 20:26:56 UTC
Partial fix:

changeset:   90897:3b300895e2d8
description:
Make web.client.tools.impl module a friend module.

changeset:   90898:f30eee0c12bc
files:       web.client.tools.impl/nbproject/project.xml
web.client.tools.impl/src/org/netbeans/modules/web/client/javascript/debugger/ui/ToolTipAnnotation.java
description:
Partial fix for issue# 140834 - Expression Evaluation upon Hovering

Use method provided by Tor to compute the expressions at the cursor position.

The expressions like:

,this.prop // no space
array[0].prop // array dereference

are still not working.
Comment 2 _ deva 2008-07-22 19:37:11 UTC
After discussions with Tor, he addressed the following scenario also
- call expression preceded by , or unary operator. Example: ,this.currentWidth or !this.currentWidth

Other scenario which doesn't work is
- call expression containing () or []. Example: array[0].prop or document.getElementById("fisheye_menu").id

Here is Tor's suggestion(taken from his email)
----------------
If your code can use parse information (which can be much slower, e.g. perhaps 200-600 ms) then we should be able to 
do something similar; it will parse the code, get an AST, use the lex information and the parse information to find 
the expression beginning, and pull out the document contents from the start to end regions.

HOWEVER -- I've worked on debuggers in the past, and one thing we never did was evaluate expressions by flyover (only 
over selected text). The reason for that was that executing code could be dangerous -- not just if it's calling 
System.exit(), but if it's deleting files or has other unintended side effects. Perhaps in JavaScript this is much 
less of a big deal since it's typically not going to cause problems in a sandboxed webapp?
----------------

I do not think we will be able to address it in 6.5, however, we should document this 
Comment 3 Martin Entlicher 2012-09-03 08:31:55 UTC
A new implementation of JavaScript debugger is in trunk. Closing old issues.