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

Bug 490736

Summary: [cross file linting] Undeclared function linting incorrectly reports forEach as undefined
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 12.0   
Target Milestone: 13.0   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2016-03-30 17:22:32 EDT
Steps:

1. load up load-rules-async.js in the javascript bundle
2. scope.variables.forEach / some is marked in a few places incorrectly

Since neither scope or variables is doc'd or assigned anywhere, there should be no type information - and I thought we ignored that.
Comment 1 Michael Rennie CLA 2016-03-30 17:24:05 EDT
Even more curious - put the cursor in variables (of any of the scope.variables.forEach/some expressions) and hit F3 (open decl). It tells you it is incorrectly coming from the node index.
Comment 2 Curtis Windatt CLA 2016-03-30 18:14:33 EDT
The node index defines 'variables' with doc and a number of properties.  Tern thinks scope.variables is this type.  forEach is not one of the properties and is therefore marked as an error.

I'm not sure why Tern decides scope.variables is of the type from the Node index.  If I turn off the node plugin then there are no more issues in the file.  Could be a problem with the index or how Tern is assigning types.
Comment 3 Curtis Windatt CLA 2016-06-29 12:30:36 EDT
The scope.variables functions are no longer marked because we don't consider guessed type information (which the types coming from node index were).

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6316070f4d3feb82f1b02416c869d91a0f2b5f20
I pushed some doc updated to fix the other cross file lint errors.