It has been successfully tested with different cases and now it behaviour is like ActionScript 2.0
With this function, and dedicated Strict shortcut one, You can:
- define a return type, using a specific constructor or Void, if function mustn't return any kind of variable (null too)
- define one or more argument constructor, using specified constructor or Void if function mustn't accept any kind of parameter (null too)
- use a generic Object constructor, as returned or accepted instance if You don't know what kind of object function, r method, will accpet or return
You can use Object for DOM elements too, expecially with Internet Explorer (6 or lower) where DOM Elements are typeof "object" but aren't instances of Object.
Object is the super incoming or outgoing value type, it can be null or every kind of instance (obviously, Void is not Object, so You can't use Object to return Void values and vice-versa).
Performance ? Good enought, so have fun with JavaStrict :-)
(read here to view some example)