dom/webidl/DOMException.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/webidl/DOMException.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,97 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + *
     1.9 + * The origin of this IDL file is
    1.10 + * http://dom.spec.whatwg.org/#exception-domexception
    1.11 + *
    1.12 + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
    1.13 + * liability, trademark and document use rules apply.
    1.14 + */
    1.15 +
    1.16 +
    1.17 +// This is the WebIDL version of nsIException.  This is mostly legacy stuff.
    1.18 +
    1.19 +interface StackFrame;
    1.20 +
    1.21 +[NoInterfaceObject]
    1.22 +interface ExceptionMembers
    1.23 +{
    1.24 +  // A custom message set by the thrower.
    1.25 +  readonly attribute DOMString               message;
    1.26 +  // The nsresult associated with this exception.
    1.27 +  readonly attribute unsigned long           result;
    1.28 +  // The name of the error code (ie, a string repr of |result|)
    1.29 +  readonly attribute DOMString               name;
    1.30 +
    1.31 +  // Filename location.  This is the location that caused the
    1.32 +  // error, which may or may not be a source file location.
    1.33 +  // For example, standard language errors would generally have
    1.34 +  // the same location as their top stack entry.  File
    1.35 +  // parsers may put the location of the file they were parsing,
    1.36 +  // etc.
    1.37 +
    1.38 +  // null indicates "no data"
    1.39 +  readonly attribute DOMString               filename;
    1.40 +  // Valid line numbers begin at '1'. '0' indicates unknown.
    1.41 +  readonly attribute unsigned long           lineNumber;
    1.42 +  // Valid column numbers begin at 0. 
    1.43 +  // We don't have an unambiguous indicator for unknown.
    1.44 +  readonly attribute unsigned long           columnNumber;
    1.45 +
    1.46 +  // A stack trace, if available.  nsIStackFrame does not have classinfo so
    1.47 +  // this was only ever usefully available to chrome JS.
    1.48 +  [ChromeOnly]
    1.49 +  readonly attribute StackFrame?             location;
    1.50 +  // An inner exception that triggered this, if available.
    1.51 +  readonly attribute nsISupports?            inner;
    1.52 +
    1.53 +  // Arbitary data for the implementation.
    1.54 +  readonly attribute nsISupports?            data;
    1.55 +
    1.56 +  // A generic formatter - make it suitable to print, etc.
    1.57 +  stringifier;
    1.58 +};
    1.59 +
    1.60 +[NoInterfaceObject]
    1.61 +interface Exception {
    1.62 +};
    1.63 +
    1.64 +Exception implements ExceptionMembers;
    1.65 +
    1.66 +// XXXkhuey this is an 'exception', not an interface, but we don't have any
    1.67 +// parser or codegen mechanisms for dealing with exceptions.
    1.68 +interface DOMException {
    1.69 +  const unsigned short INDEX_SIZE_ERR = 1;
    1.70 +  const unsigned short DOMSTRING_SIZE_ERR = 2; // historical
    1.71 +  const unsigned short HIERARCHY_REQUEST_ERR = 3;
    1.72 +  const unsigned short WRONG_DOCUMENT_ERR = 4;
    1.73 +  const unsigned short INVALID_CHARACTER_ERR = 5;
    1.74 +  const unsigned short NO_DATA_ALLOWED_ERR = 6; // historical
    1.75 +  const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
    1.76 +  const unsigned short NOT_FOUND_ERR = 8;
    1.77 +  const unsigned short NOT_SUPPORTED_ERR = 9;
    1.78 +  const unsigned short INUSE_ATTRIBUTE_ERR = 10; // historical
    1.79 +  const unsigned short INVALID_STATE_ERR = 11;
    1.80 +  const unsigned short SYNTAX_ERR = 12;
    1.81 +  const unsigned short INVALID_MODIFICATION_ERR = 13;
    1.82 +  const unsigned short NAMESPACE_ERR = 14;
    1.83 +  const unsigned short INVALID_ACCESS_ERR = 15;
    1.84 +  const unsigned short VALIDATION_ERR = 16; // historical
    1.85 +  const unsigned short TYPE_MISMATCH_ERR = 17; // historical; use JavaScript's TypeError instead
    1.86 +  const unsigned short SECURITY_ERR = 18;
    1.87 +  const unsigned short NETWORK_ERR = 19;
    1.88 +  const unsigned short ABORT_ERR = 20;
    1.89 +  const unsigned short URL_MISMATCH_ERR = 21;
    1.90 +  const unsigned short QUOTA_EXCEEDED_ERR = 22;
    1.91 +  const unsigned short TIMEOUT_ERR = 23;
    1.92 +  const unsigned short INVALID_NODE_TYPE_ERR = 24;
    1.93 +  const unsigned short DATA_CLONE_ERR = 25;
    1.94 +
    1.95 +  readonly attribute unsigned short code;
    1.96 +};
    1.97 +
    1.98 +// XXXkhuey copy all of Gecko's non-standard stuff onto DOMException, but leave
    1.99 +// the prototype chain sane.
   1.100 +DOMException implements ExceptionMembers;

mercurial