yes, and yes
For the first:
It isn't clear what you want but let me give two solutions:
If a variable "x" is actually an instance of a subclass of goog.storage.ExpiringStorage:
x instanceof goog.storage.ExpiringStorage
If a variable "x" is an alias of the constructor (you are passing the constructor to your function) you can do:
for (var tmp = x, found = false; tmp != null; tmp = tmp.superClass_) {
if (tmp == goog.storage.ExpiringStorage) {
found = true;
break;
}
}
What you propose is a bit fragile, as you are relying subclass constructor having a known set of parameters. One alternative is to instead pass a "factory" function that take a know set of parameters. As you would be writing this yourself, you can be certain no one is passing in a incompatible constructor.
For the second:
Assuming x is a function, then "x.length" returns the number of declared parameters, but you don't really want to use this in ADVANCED compiled code as the compiler can rewrite the function definition to remove unused or inline constant parameters.