From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- xpcom/base/nsIException.idl | 80 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 xpcom/base/nsIException.idl (limited to 'xpcom/base/nsIException.idl') diff --git a/xpcom/base/nsIException.idl b/xpcom/base/nsIException.idl new file mode 100644 index 0000000000..7f529e1c08 --- /dev/null +++ b/xpcom/base/nsIException.idl @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Interfaces for representing cross-language exceptions and stack traces. + */ +#include "nsISupports.idl" + +[ptr] native JSContext(JSContext); +native StackFrameRef(already_AddRefed); + +[scriptable, builtinclass, uuid(28bfb2a2-5ea6-4738-918b-049dc4d51f0b)] +interface nsIStackFrame : nsISupports +{ + [implicit_jscontext, binaryname(FilenameXPCOM)] + readonly attribute AString filename; + [implicit_jscontext, binaryname(NameXPCOM)] + readonly attribute AString name; + // Unique identifier of the script source for the frame, or zero. + [implicit_jscontext, binaryname(SourceIdXPCOM)] + readonly attribute int32_t sourceId; + // Valid line numbers begin at '1'. '0' indicates unknown. + [implicit_jscontext, binaryname(LineNumberXPCOM)] + readonly attribute int32_t lineNumber; + [implicit_jscontext, binaryname(ColumnNumberXPCOM)] + readonly attribute int32_t columnNumber; + readonly attribute AUTF8String sourceLine; + [implicit_jscontext, binaryname(AsyncCauseXPCOM)] + readonly attribute AString asyncCause; + [implicit_jscontext, binaryname(AsyncCallerXPCOM)] + readonly attribute nsIStackFrame asyncCaller; + [implicit_jscontext, binaryname(CallerXPCOM)] + readonly attribute nsIStackFrame caller; + + // Returns a formatted stack string that looks like the sort of + // string that would be returned by .stack on JS Error objects. + // Only works on JS-language stack frames. + [implicit_jscontext, binaryname(FormattedStackXPCOM)] + readonly attribute AString formattedStack; + + // Returns the underlying SavedFrame object for native JavaScript stacks, + // or null if this is not a native JavaScript stack frame. + readonly attribute jsval nativeSavedFrame; + + [implicit_jscontext, binaryname(ToStringXPCOM)] + AUTF8String toString(); + + // Infallible things to be called from C++. + [notxpcom, nostdcall] + void getFilename(in JSContext aCx, out AString aFilename); + [notxpcom, nostdcall] + void getName(in JSContext aCx, out AString aName); + [notxpcom, nostdcall] + int32_t getSourceId(in JSContext aCx); + [notxpcom, nostdcall] + int32_t getLineNumber(in JSContext aCx); + [notxpcom, nostdcall] + int32_t getColumnNumber(in JSContext aCx); + [notxpcom, nostdcall] + void getAsyncCause(in JSContext aCx, out AString aAsyncCause); + [notxpcom, nostdcall] + StackFrameRef getAsyncCaller(in JSContext aCx); + [notxpcom, nostdcall] + StackFrameRef getCaller(in JSContext aCx); + [notxpcom, nostdcall] + void getFormattedStack(in JSContext aCx, out AString aFormattedStack); + [notxpcom, nostdcall, binaryname(ToString)] + void toStringInfallible(in JSContext aCx, out AUTF8String aString); +}; + +// This interface only exists because of all the JS consumers doing +// "instanceof Ci.nsIException". We should switch them to something else and +// get rid of it; bug 1435856 tracks that. C++ code should NOT use this; use +// mozilla::dom::Exception instead. +[scriptable, builtinclass, uuid(4371b5bf-6845-487f-8d9d-3f1e4a9badd2)] +interface nsIException : nsISupports +{ +}; -- cgit v1.2.3