Global

Members

cgxp: Object

gmfThemes: Object

gmfx: Object

lidarprofileServer: Object

Methods

assert(condition, [opt_message]opt, var_args)

Checks if the condition evaluates to true if goog.asserts.ENABLE_ASSERTS is true.

Parameters:
Name Type Attributes Description
condition T

The condition to check.

[opt_message] string= <optional>

Error message in case of failure.

var_args ...*

The items to substitute into the failure message.

Throws:

When the condition evaluates to false.

Type
goog.asserts.AssertionError
Returns:
T

The value of the condition.

assertArray(value, [opt_message]opt, var_args)

Checks if the value is an Array if goog.asserts.ENABLE_ASSERTS is true.

Parameters:
Name Type Attributes Description
value *

The value to check.

[opt_message] string= <optional>

Error message in case of failure.

var_args ...*

The items to substitute into the failure message.

Throws:

When the value is not an array.

Type
goog.asserts.AssertionError
Returns:
!Array

The value, guaranteed to be a non-null array.

assertBoolean(value, [opt_message]opt, var_args)

Checks if the value is a boolean if goog.asserts.ENABLE_ASSERTS is true.

Parameters:
Name Type Attributes Description
value *

The value to check.

[opt_message] string= <optional>

Error message in case of failure.

var_args ...*

The items to substitute into the failure message.

Throws:

When the value is not a boolean.

Type
goog.asserts.AssertionError
Returns:
boolean

The value, guaranteed to be a boolean when asserts are enabled.

assertElement(value, [opt_message]opt, var_args)

Checks if the value is a DOM Element if goog.asserts.ENABLE_ASSERTS is true.

Parameters:
Name Type Attributes Description
value *

The value to check.

[opt_message] string= <optional>

Error message in case of failure.

var_args ...*

The items to substitute into the failure message.

Throws:

When the value is not an Element.

Type
goog.asserts.AssertionError
Returns:
!Element

The value, likely to be a DOM Element when asserts are enabled.

assertFunction(value, [opt_message]opt, var_args)

Checks if the value is a function if goog.asserts.ENABLE_ASSERTS is true.

Parameters:
Name Type Attributes Description
value *

The value to check.

[opt_message] string= <optional>

Error message in case of failure.

var_args ...*

The items to substitute into the failure message.

Throws:

When the value is not a function.

Type
goog.asserts.AssertionError
Returns:
!Function

The value, guaranteed to be a function when asserts enabled.

assertInstanceof(value, type, [opt_message]opt, var_args)

Checks if the value is an instance of the user-defined type if goog.asserts.ENABLE_ASSERTS is true.

The compiler may tighten the type returned by this function.

Parameters:
Name Type Attributes Description
value ?

The value to check.

type function(new: T, ...)

A user-defined constructor.

[opt_message] string= <optional>

Error message in case of failure.

var_args ...*

The items to substitute into the failure message.

Throws:

When the value is not an instance of type.

Type
goog.asserts.AssertionError
Returns:
T

assertNumber(value, [opt_message]opt, var_args)

Checks if the value is a number if goog.asserts.ENABLE_ASSERTS is true.

Parameters:
Name Type Attributes Description
value *

The value to check.

[opt_message] string= <optional>

Error message in case of failure.

var_args ...*

The items to substitute into the failure message.

Throws:

When the value is not a number.

Type
goog.asserts.AssertionError
Returns:
number

The value, guaranteed to be a number when asserts enabled.

assertObject(value, [opt_message]opt, var_args)

Checks if the value is an Object if goog.asserts.ENABLE_ASSERTS is true.

Parameters:
Name Type Attributes Description
value *

The value to check.

[opt_message] string= <optional>

Error message in case of failure.

var_args ...*

The items to substitute into the failure message.

Throws:

When the value is not an object.

Type
goog.asserts.AssertionError
Returns:
!Object

The value, guaranteed to be a non-null object.

assertObjectPrototypeIsIntact()

Checks that no enumerable keys are present in Object.prototype. Such keys would break most code that use {@code for (var ... in ...)} loops.

assertString(value, [opt_message]opt, var_args)

Checks if the value is a string if goog.asserts.ENABLE_ASSERTS is true.

Parameters:
Name Type Attributes Description
value *

The value to check.

[opt_message] string= <optional>

Error message in case of failure.

var_args ...*

The items to substitute into the failure message.

Throws:

When the value is not a string.

Type
goog.asserts.AssertionError
Returns:
string

The value, guaranteed to be a string when asserts enabled.

fail([opt_message]opt, var_args)

Fails if goog.asserts.ENABLE_ASSERTS is true. This function is useful in case when we want to add a check in the unreachable area like switch-case statement:

 switch(type) {
   case FOO: doSomething(); break;
   case BAR: doSomethingElse(); break;
   default: goog.asserts.fail('Unrecognized type: ' + type);
     // We have only 2 types - "default:" section is unreachable code.
 }
Parameters:
Name Type Attributes Description
[opt_message] string= <optional>

Error message in case of failure.

var_args ...*

The items to substitute into the failure message.

Throws:

Failure.

Type
goog.asserts.AssertionError

setErrorHandler(errorHandler)

Sets a custom error handler that can be used to customize the behavior of assertion failures, for example by turning all assertion failures into log messages.

Parameters:
Name Type Description
errorHandler function(!goog.asserts.AssertionError)