I am trying to use Eclipse to develop server side Javascript.
The API I use has a function doStuff(string, object)(names changed to protect the perpetrators) that returns the value of different types (subclasses of the same type) depending on the (values) of the arguments passed to them.
I created a Javascript library to describe this function:
doStuff = function(str, obj} {return new ResultType();}
Since it can return multiple types, I declared it to return the base type. However, this means that Eclipse does not know what type it actually is, and therefore I get later false errors when trying to access the fields of this object.
So there could be FooResultType, BarResultType, each of which is ResultTypes, but has additional fields / functions
? - , , Eclipse , ?
( FooResultType)
v = doStuff("stringvalue", someObject);
.
( , , , )