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

Bug 490737

Summary: [cross file linting] Undeclared functions should not apply to types documented as {Object}
Product: [ECD] Orion Reporter: Curtis Windatt <curtis.windatt.public>
Component: JS ToolsAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: 12.0   
Target Milestone: 12.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Curtis Windatt CLA 2016-03-30 17:33:12 EDT
function foo(a){
a.b();
}

This does not produce an error

/**
* @param {Object} a
*/
function foo(a){
a.b();
}

This does produce an error.

If Tern thinks the type of the parent is a basic Object (no additional properties) then we should not report any errors.  While it would be great to encourage users to enter more specific type information into doc, it does not make {Object} incorrect.
Comment 1 Curtis Windatt CLA 2016-03-30 18:05:21 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=dda2acf242abf201f9b05dca5fdf01f9103d9db3
Fixed in master with tests

As I suspected, this means we don't report a problem for
var a = {};
a.b();

Since the case of documenting things as {Object} should be far more common than defining an object with no properties then call a property on it, I think this fix is correct.