selenium-webdriver
Version:
The official WebDriver JavaScript bindings from the Selenium project
27 lines (26 loc) • 19.5 kB
HTML
<meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>goog.debug</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Namespace goog.debug</h1><a class="source" href="source/lib/goog/debug/logrecord.js.src.html#l22">code »</a></header><section></section><section><h2>Interfaces</h2><div class="type-summary"><table><tbody><tr><td><dl><dt><a href="interface_goog_debug_EntryPointMonitor.html">goog.debug.EntryPointMonitor</a><dd>No Description.</dl></table></div></section><section><h2>Classes</h2><div class="type-summary"><table><tbody><tr><td><dl><dt><a href="class_goog_debug_Error.html">goog.debug.Error</a><dd>Base class for custom error objects.<dt><a href="class_goog_debug_LogBuffer.html">goog.debug.LogBuffer</a><dd>Creates the log buffer.<dt><a href="class_goog_debug_LogRecord.html">goog.debug.LogRecord</a><dd>LogRecord objects are used to pass logging requests between
the logging framework and individual log Handlers.<dt><a href="class_goog_debug_Logger.html">goog.debug.Logger</a><dd>The Logger is an object used for logging debug messages.</dl></table></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="typedefs"><h2>Type Definitions</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/debug/logger.js.src.html#l44">code »</a><a class="member" name="goog.debug.Loggable">goog.debug.Loggable</a> : <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>|function(): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code></div><div>A message value that can be handled by a Logger.
Functions are treated like callbacks, but are only called when the event's
log level is enabled. This is useful for logging messages that are expensive
to construct.</div></summary></details></div></div></section><section id="static-functions"><h2>Global Functions</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l41">code »</a><span class="member"><a name="goog.debug.catchErrors">goog.debug.catchErrors</a> <span class="args">( logFunc, opt_cancel, opt_target )</span></span></div><p>Catches onerror events fired by windows and similar objects.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>logFunc: <code class="type">function(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>)</code><dd>The function to call with the error
information.<dt>opt_cancel: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether to stop the error from reaching the
browser.<dt>opt_target: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>=</code><dd>Object that fires onerror events.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l143">code »</a><span class="member"><a name="goog.debug.deepExpose">goog.debug.deepExpose</a> <span class="args">( obj, opt_showFn )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Creates a string representing a given primitive or object, and for an
object, all its properties and nested objects. WARNING: If an object is
given, it and all its nested objects will be modified. To detect reference
cycles, this method identifies objects using goog.getUid() which mutates the
object.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>obj: <code class="type">*</code><dd>Object to expose.<dt>opt_showFn: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Also show properties that are functions (by
default, functions are omitted).</dl><tr><th>Returns<tr><td><dl>A string representation of <code >obj</code>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l307">code »</a><span class="member"><a name="goog.debug.enhanceError">goog.debug.enhanceError</a> <span class="args">( err, opt_message )</span> ⇒ <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error">Error</a></code></span></div><p>Converts an object to an Error if it's a String,
adds a stacktrace if there isn't one,
and optionally adds an extra message.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>err: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error">Error</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code><dd>the original thrown object or string.<dt>opt_message: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>optional additional message to add to the
error.</dl><tr><th>Returns<tr><td><dl>If err is a string, it is used to create a new Error,
which is enhanced and returned. Otherwise err itself is enhanced
and returned.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l106">code »</a><span class="member"><a name="goog.debug.expose">goog.debug.expose</a> <span class="args">( obj, opt_showFn )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Creates a string representing an object and all its properties.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>obj: <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Null">null</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>)</code><dd>Object to expose.<dt>opt_showFn: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Show the functions as well as the properties,
default is false.</dl><tr><th>Returns<tr><td><dl>The string representation of <code >obj</code>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l199">code »</a><span class="member"><a name="goog.debug.exposeArray">goog.debug.exposeArray</a> <span class="args">( arr )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Recursively outputs a nested array as a string.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code><dd>The array.</dl><tr><th>Returns<tr><td><dl>String representing nested array.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l219">code »</a><span class="member"><a name="goog.debug.exposeException">goog.debug.exposeException</a> <span class="args">( err, opt_fn )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Exposes an exception that has been caught by a try...catch and outputs the
error with a stack trace.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>err: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code><dd>Error object or string.<dt>opt_fn: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>=</code><dd>Optional function to start stack trace from.</dl><tr><th>Returns<tr><td><dl>Details of exception.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l590">code »</a><span class="member"><a name="goog.debug.fnNameResolver_">goog.debug.fnNameResolver_</a> <span class="args">( )</span> ⇒ <code class="type">string</code></span></div><p>Resolves functions to their names. Resolved function names will be cached.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l533">code »</a><span class="member"><a name="goog.debug.getFunctionName">goog.debug.getFunctionName</a> <span class="args">( fn )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Gets a function name</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>fn: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>Function to get name of.</dl><tr><th>Returns<tr><td><dl>Function's name.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l394">code »</a><span class="member"><a name="goog.debug.getNativeStackTrace_">goog.debug.getNativeStackTrace_</a> <span class="args">( fn )</span> ⇒ <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>fn: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>The function to start getting the trace from.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l423">code »</a><span class="member"><a name="goog.debug.getStacktrace">goog.debug.getStacktrace</a> <span class="args">( opt_fn )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Gets the current stack trace, either starting from the caller or starting
from a specified function that's currently on the call stack.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_fn: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>=</code><dd>Optional function to start getting the trace from.
If not provided, defaults to the function that called this.</dl><tr><th>Returns<tr><td><dl>Stack trace.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l448">code »</a><span class="member"><a name="goog.debug.getStacktraceHelper_">goog.debug.getStacktraceHelper_</a> <span class="args">( fn, visited )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Private helper for getStacktrace().</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>fn: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code><dd>Function to start getting the trace from.<dt>visited: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code><dd>List of functions visited so far.</dl><tr><th>Returns<tr><td><dl>Stack trace starting from function fn.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l342">code »</a><span class="member"><a name="goog.debug.getStacktraceSimple">goog.debug.getStacktraceSimple</a> <span class="args">( opt_depth )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Gets the current stack trace. Simple and iterative - doesn't worry about
catching circular references or getting the args.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_depth: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>Optional maximum depth to trace back to.</dl><tr><th>Returns<tr><td><dl>A string with the function names of all functions in the
stack, separated by \n.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l568">code »</a><span class="member"><a name="goog.debug.makeWhitespaceVisible">goog.debug.makeWhitespaceVisible</a> <span class="args">( string )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Makes whitespace visible by replacing it with printable characters.
This is useful in finding diffrences between the expected and the actual
output strings of a testcase.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>string: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>whose whitespace needs to be made visible.</dl><tr><th>Returns<tr><td><dl>string whose whitespace is made visible.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l243">code »</a><span class="member"><a name="goog.debug.normalizeErrorObject">goog.debug.normalizeErrorObject</a> <span class="args">( err )</span> ⇒ <code class="type">!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code></span></div><p>Normalizes the error/exception object between browsers.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>err: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code><dd>Raw error object.</dl><tr><th>Returns<tr><td><dl>Normalized error object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l523">code »</a><span class="member"><a name="goog.debug.setFunctionResolver">goog.debug.setFunctionResolver</a> <span class="args">( resolver )</span></span></div><p>Set a custom function name resolver.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>resolver: <code class="type">function(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>Resolves functions to their
names.</dl></table></div></details></div></div></section><section id="static-properties"><h2>Global Properties</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l386">code »</a><span class="member"><a name="goog.debug.MAX_STACK_DEPTH">goog.debug.MAX_STACK_DEPTH</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>Max length of stack to try and output</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l582">code »</a><span class="member"><a name="goog.debug.fnNameCache_">goog.debug.fnNameCache_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code></span></div><p>Hash map for storing function names that have already been looked up.</summary></details></div></div></section><section id="compiler-constants"><h2>Compiler Constants</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/debug/debug.js.src.html#l30">code »</a><span class="member"><a name="goog.debug.LOGGING_ENABLED">goog.debug.LOGGING_ENABLED</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>Loading</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>Loading</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>Loading</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script>