/*
 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

[
    DoNotCheckConstants,
    ImplementationLacksVTable,
    OperationsNotDeletable
] exception RangeException {

    readonly attribute unsigned short   code;
    readonly attribute DOMString        name;
    readonly attribute DOMString        message;

#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
    [NotEnumerable] DOMString toString();
#endif

    // DOM Level 2

    const unsigned short BAD_BOUNDARYPOINTS_ERR = 1;
    const unsigned short INVALID_NODE_TYPE_ERR = 2;
};

