User Guide
Comparing the Error classes 273
TypeError The TypeError exception is
thrown when the actual type of
an operand is different from the
expected type.
For more information, see
Section 15.11.6.5 of the
ECMAScript specification at
www.ecma-international.org/
publications/standards/Ecma-
262.htm, as well as Section 10.3
of the E4X specification at
www.ecma-international.org/
publications/standards/Ecma-
357.htm.
A TypeError can be thrown under the
following circumstances:
• An actual parameter of a function or
method could not be coerced to the
formal parameter type.
• A value is assigned to a variable and
cannot be coerced to the variable’s
type.
• The right side of the
is or instanceof
operator is not a valid type.
• The
super keyword is used illegally.
• A property lookup results in more than
one binding, and is therefore
ambiguous.
• A method is invoked on an
incompatible object. For example, a
TypeError exception is thrown if a
method in the RegExp class is
“grafted” onto a generic object and
then invoked.
URIError The URIError exception is thrown
when one of the global URI
handling functions is used in a
way that is incompatible with its
definition.
For more information, see
Section 15.11.6.6 of the
ECMAScript specification at
www.ecma-international.org/
publications/standards/Ecma-
262.htm.
A URIError can be thrown under the
following circumstances:
An invalid URI is specified for a Flash
Player API function that expects a valid
URI, such as
Socket.connect().
Class name Description Notes