Maps API for JavaScript Developer's Guide

H.lang.OutOfRangeError

Class Summary

This class encapsulates information about an error to throw if the value supplied by the caller is out of range.

[ For full details, see the Class Details ]

Class Description

This class encapsulates information about an error to throw if the value supplied by the caller is out of range.

Example

H.Foo.prototype.bar = function(array, idx) {
  if(idx < 0) throw new H.lang.OutOfRangeError(
  H.Foo.prototype.bar, 2, 0, array.length - 1);
}
new H.Foo().bar( -4, [0, 1]); // ==> 'OutOfrange: H.Foo#bar (-4 out of [0...1])

Constructor Details

H.lang.OutOfRangeError(opt_caller, opt_val, opt_range)

Parameters:
 
opt_caller:
{Function=} [optional]
 
The calling function
opt_val:
{number=} [optional]
 
The value to check against the range specified by opt_range
opt_range:
{Array<number>=} [optional]
 
Values defining the validity range (as [min, max])