Returns the name of a type of object.
|
code » | ||
![]()
Adds all known constructors to the type registry.
|
code » | ||
![]()
Registers a type which will be recognized by goog.debug.reflect.typeOf.
|
code » | ||
![]()
Copy of
Object.prototype.toString to use if it is overridden later.
Although saving the original toString somewhat protects against
third-party libraries which touch Object.prototype , the actual goal
of this assignment is to allow overriding that method, thus more debug
information can be exposed about objects.
See goog.debug.reflect.typeOf .
|
code » | ||
Guesses the real type of the object, even if its
toString method is
overridden. Gives exact result for all goog.provided classes in non-compiled
code, and some often used native classes in compiled code too. Not tested in
multi-frame environment.
Example use case to get better type information in the Watch tab of FireBug:
Object.prototype.toString = function() { return goog.debug.reflect.typeOf(this); };
Arguments:
Returns: string
The namespaced type of the argument or 'Object' if didn't
manage to determine it. Warning: in IE7 ActiveX (including DOM) objects
don't expose their type to JavaScript. Their
constructor
property is undefined and they are not even the instances of the
Object type. This method will recognize them as 'ActiveXObject'.
|
code » |