Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 454051

Summary: hovering over a function definition can show hover help with "undefined"
Product: [ECD] Orion Reporter: Grant Gayed <grant_gayed>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: unspecified   
Target Milestone: 8.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
screenshot none

Description Grant Gayed CLA 2014-12-03 14:52:05 EST
Created attachment 249146 [details]
screenshot

Happens with our latest on orion.eclipse.org.  Steps:

- retrieve our latest client code (needed because I see this when hovering over code that I've just released, I didn't find a more general case)
- open file metrics.js
- hover over its setDimension() function definition
  -> a tooltip is shown with "undefined" and missing content (screenshot is attached)
Comment 1 Michael Rennie CLA 2014-12-04 13:46:36 EST
This is because the code was throwing an exception while processing the AST.

Here is a simpler example:

function f() {
    var v = 10; //LINE COMMENT IN LAST STATEMENT
}

function g() {
    
}

Esprima was attaching the line comment from the last statement to the leading comments array for the following function declaration

Fix:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=fc0bc9ee18a723604d35989435350d7f45e3d1bf