goog.debug
Functions
catchErrors( logFunc, opt_cancel, opt_target ) → void
void
deepExpose( obj, opt_showFn ) → string
string
Creates a string representing a given primitive or object, and for an object, all its properties and nested objects. NOTE: The output will include Uids on all objects that were exposed. Any added Uids will be removed before returning.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
enhanceError( err, opt_message ) → Error
Error
Converts an object to an Error using the object's toString if it's not already an Error, adds a stacktrace if there isn't one, and optionally adds an extra message.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
enhanceErrorWithContext( err, opt_context ) → Error
Error
Converts an object to an Error using the object's toString if it's not already an Error, adds a stacktrace if there isn't one, and optionally adds context to the Error, which is reported by the closure error reporter.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
expose( obj, opt_showFn ) → string
string
exposeArray( arr ) → string
string
freeze<T>( arg ) → T
T
Freezes the given object, but only in debug mode (and in browsers that support it). Note that this is a shallow freeze, so for deeply nested objects it must be called at every level to ensure deep immutability.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getFunctionName( fn ) → string
string
Gets a function name
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getStacktrace( fn ) → string
string
Gets the current stack trace, either starting from the caller or starting from a specified function that's currently on the call stack.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getStacktraceSimple( opt_depth ) → string
string
makeWhitespaceVisible( string ) → string
string
normalizeErrorObject( err ) → {fileName: (?|undefined), lineNumber: (?|undefined), message: (?|undefined), name: (?|undefined), stack: (?|undefined)}
{fileName: (?|undefined), lineNumber: (?|undefined), message: (?|undefined), name: (?|undefined), stack: (?|undefined)}
Normalizes the error/exception object between browsers.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
runtimeType( value ) → string
string
Returns the type of a value. If a constructor is passed, and a suitable string cannot be found, 'unknown type name' will be returned.
Forked rather than moved from goog.asserts.getType_
to avoid adding a dependency to goog.asserts.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
Properties
MAX_STACK_DEPTH → number
number
Max length of stack to try and output
Compiler Constants
goog.debug.CHECK_FOR_THROWN_EVENT → boolean
boolean
TODO(user): Remove this hack once bug is resolved.
goog.debug.FORCE_SLOPPY_STACKS → boolean
boolean
Whether to force "sloppy" stack building.
goog.debug.LOGGING_ENABLED → boolean
boolean
Whether logging should be enabled.