reflect.js
No description.

File Location

/goog/debug/reflect.js


Public Protected Private

Global Functions

goog.debug.reflect.className(classConstructor) string | undefined
Returns the name of a type of object.
Arguments:
classConstructor : !Function
A object constructor to get the name of.
Returns: string | undefined  The string name of the class.
code »
goog.debug.reflect.init_()
Adds all known constructors to the type registry.
code »
goog.debug.reflect.registerType_(namector)
Registers a type which will be recognized by goog.debug.reflect.typeOf.
Arguments:
name : string
Full name of the type.
ctor : !Function
The constructor.
code »
goog.debug.reflect.toString_()
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 »
goog.debug.reflect.typeOf(obj) string
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:
obj : *
An arbitrary variable to get the type of.
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 »

Directory debug

File Reference