# Namespace webdriver.stacktrace

code »

## Classes

webdriver.stacktrace.Frame
  Class representing one stack frame.
webdriver.stacktrace.Snapshot
  Stores a snapshot of the stack trace at the time this instance was created.

Show:Public Protected Private

## Global Functions

code »webdriver.stacktrace.format ( error ) ⇒ `!(Error|goog.testing.JsUnitException)`

Formats an error's stack trace.

Parameters

error: `!(Error|goog.testing.JsUnitException)`
  The error to format.

Returns

The formatted error.

code »webdriver.stacktrace.get ( ) ⇒ `!Array`

Gets the native stack trace if available otherwise follows the call chain. The generated trace will exclude all frames up to and including the call to this function.

Returns

The frames of the stack trace.

code »webdriver.stacktrace.getStack_ ( error ) ⇒ `string`

Get an error's stack trace with the error string trimmed. V8 prepends the string representation of an error to its stack trace. This function trims the string so that the stack trace can be parsed consistently with the other JS engines.

Parameters

error: `(Error|goog.testing.JsUnitException)`
  The error.

Returns

The stack trace string.

code »webdriver.stacktrace.parseLongFirefoxFrame_ ( frameStr ) ⇒ `!webdriver.stacktrace.Frame`

Parses a long firefox stack frame.

Parameters

frameStr: `string`
  The stack frame as string.

Returns

Stack frame object.

code »webdriver.stacktrace.parseStackFrame_ ( frameStr ) ⇒ `webdriver.stacktrace.Frame`

Parses one stack frame.

Parameters

frameStr: `string`
  The stack frame as string.

Returns

Stack frame object or null if the parsing failed.

code »webdriver.stacktrace.parse_ ( stack ) ⇒ `!Array`

Parses an Error object's stack trace.

Parameters

stack: `string`
  The stack trace.

Returns

Stack frames. The unrecognized frames will be nulled out.

## Global Properties

code »webdriver.stacktrace.ANONYMOUS_CLOSURE_FRAME_ : `string`

Representation of an anonymous frame in a stack trace generated by `goog.testing.stacktrace`.

code »webdriver.stacktrace.ANONYMOUS_FRAME_ : `!webdriver.stacktrace.Frame`

Constant for an anonymous frame.

code »webdriver.stacktrace.BROWSER_SUPPORTED : `boolean`

Whether the current browser supports stack traces.

code »webdriver.stacktrace.CAN_CAPTURE_STACK_TRACE_ : `boolean`

Whether the current environment supports the Error.captureStackTrace function (as of 10/17/2012, only V8).

code »webdriver.stacktrace.CHAKRA_FUNCTION_CALL_PATTERN_ : `string`

RegExp pattern for function call in a Chakra (IE) stack trace. This expression creates 2 submatches on the (optional) context and function name, matching identifiers like 'foo.Bar.prototype.baz', 'Anonymous function', 'eval code', and 'Global code'.

code »webdriver.stacktrace.CHAKRA_STACK_FRAME_REGEXP_ : `!RegExp`

Regular expression for parsing on stack frame in Chakra (IE).

code »webdriver.stacktrace.CLOSURE_FUNCTION_CALL_PATTERN_ : `string`

Pattern for a function call in a Closure stack trace. Creates three optional submatches: the context, function name, and alias.

code »webdriver.stacktrace.CLOSURE_STACK_FRAME_REGEXP_ : `!RegExp`

Regular expression for parsing a stack frame generated by Closure's `goog.testing.stacktrace`.

code »webdriver.stacktrace.CONTEXT_PATTERN_ : `string`

Pattern for a matching the type on a fully-qualified name. Forms an optional sub-match on the type. For example, in "foo.bar.baz", will match on "foo.bar".

code »webdriver.stacktrace.FIREFOX_FUNCTION_CALL_PATTERN_ : `string`

RegExp pattern for function call in the Firefox stack trace. Creates a submatch for the function name.

code »webdriver.stacktrace.FIREFOX_FUNCTION_NAME_PATTERN_ : `string`

RegExp pattern for function names in the Firefox stack trace. Firefox has extended identifiers to deal with inner functions and anonymous functions: https://bugzilla.mozilla.org/show_bug.cgi?id=433529#c9

code »webdriver.stacktrace.FIREFOX_STACK_FRAME_REGEXP_ : `!RegExp`

Regular expression for parsing one stack frame in Firefox.

code »webdriver.stacktrace.IDENTIFIER_PATTERN_ : `string`

RegExp pattern for JavaScript identifiers. We don't support Unicode identifiers defined in ECMAScript v3.

code »webdriver.stacktrace.MAX_FIREFOX_FRAMESTRING_LENGTH_ : `number`

Maximum length of a string that can be matched with a RegExp on Firefox 3x. Exceeding this approximate length will cause string.match to exceed Firefox's stack quota. This situation can be encountered when goog.globalEval is invoked with a long argument; such as when loading a module.

code »webdriver.stacktrace.OPERA_ANONYMOUS_FUNCTION_NAME_PATTERN_ : `string`

RegExp pattern for an anonymous function call in an Opera stack frame. Creates 2 (optional) submatches: the context object and function name.

code »webdriver.stacktrace.OPERA_FUNCTION_CALL_PATTERN_ : `string`

RegExp pattern for a function call in an Opera stack frame. Creates 3 (optional) submatches: the function name (if not anonymous), the aliased context object and the function name (if anonymous).

code »webdriver.stacktrace.OPERA_STACK_FRAME_REGEXP_ : `!RegExp`

Regular expression for parsing on stack frame in Opera 11.68+

code »webdriver.stacktrace.QUALIFIED_NAME_PATTERN_ : `string`

Pattern for matching a fully qualified name. Will create two sub-matches: the type (optional), and the name. For example, in "foo.bar.baz", will match on ["foo.bar", "baz"].

code »webdriver.stacktrace.UNKNOWN_CLOSURE_FRAME_ : `string`

Placeholder for an unparsable frame in a stack trace generated by `goog.testing.stacktrace`.

code »webdriver.stacktrace.URL_PATTERN_ : `string`

RegExp pattern for an URL + position inside the file.

code »webdriver.stacktrace.V8_ALIAS_PATTERN_ : `string`

RegExp pattern for function name alias in the V8 stack trace.

code »webdriver.stacktrace.V8_CONTEXT_PATTERN_ : `string`

RegExp pattern for the context of a function call in V8. Creates two submatches, only one of which will ever match: either the namespace identifier (with optional "new" keyword in the case of a constructor call), or just the "new " phrase for a top level constructor call.

code »webdriver.stacktrace.V8_FUNCTION_CALL_PATTERN_ : `string`

RegExp pattern for function call in the V8 stack trace. Creates 3 submatches with context object (optional), function name and function alias (optional).

code »webdriver.stacktrace.V8_FUNCTION_NAME_PATTERN_ : `string`

RegExp pattern for function names and constructor calls in the V8 stack trace.

code »webdriver.stacktrace.V8_LOCATION_PATTERN_ : `string`

RegExp pattern for a location string in a V8 stack frame. Creates two submatches for the location, one for enclosed in parentheticals and on where the location appears alone (which will only occur if the location is the only information in the frame).

code »webdriver.stacktrace.V8_STACK_FRAME_REGEXP_ : `!RegExp`

Regular expression for parsing one stack frame in V8.