Interface nsIScriptErrorType

Hierarchy

Properties

category: string

Categories I know about - XUL javascript content javascript (both of these from nsDocShell, currently) system javascript (errors in JS components and other system JS)

columnNumber: uint32_t
cssSelectors: string

If the ScriptError is a CSS parser error, this value will contain the CSS selectors of the CSS ruleset where the error occured.

errorMessage: string

The error message without any context/line number information.

Note

nsIConsoleMessage.message will return the error formatted with file/line information.

errorMessageName: string

The name of a template string associated with the error message. See js/public/friend/ErrorNumbers.msg.

exception: any
flags: uint32_t
hasException: boolean
innerWindowID: number

Get the inner window id this was initialized with. Zero will be returned if init() was used instead of initWithWindowID().

isForwardedFromContentProcess: boolean
isFromChromeContext: boolean
isFromPrivateWindow: boolean
isPromiseRejection: boolean
lineNumber: uint32_t
logLevel: uint32_t

The log level of this message.

message: string
microSecondTimeStamp: number

The time (in microseconds from the Epoch) that the message instance was initialised. The timestamp is initialized as JS_now.

notes: nsIArray
outerWindowID: number

Get the window id this was initialized with. Zero will be returned if init() was used instead of initWithWindowID().

sourceId: uint32_t

Unique identifier within the process for the script source this error is associated with, or zero.

sourceLine: string
sourceName: string
stack: any
stackGlobal: any

If |stack| is an object, then stackGlobal must be a global object that's same-compartment with |stack|. This can be used to enter the correct realm when working with the stack object. We can't use the object itself because it might be a cross-compartment wrapper and CCWs are not associated with a single realm/global.

timeStamp: number

The time (in milliseconds from the Epoch) that the message instance was initialised. The timestamp is initialized as JS_now/1000 so that it can be compared to Date.now in Javascript.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • message: string
    • sourceName: string
    • sourceLine: string
    • lineNumber: uint32_t
    • columnNumber: uint32_t
    • flags: uint32_t
    • category: string
    • fromPrivateWindow: bool
    • fromChromeContext: bool

    Returns void

  • Parameters

    • isPromiseRejection: bool

    Returns void

  • Initialize the script source ID in a new error.

    Parameters

    • sourceId: uint32_t

    Returns void

  • This is the same function as initWithWindowID, but it expects an already sanitized sourceName. Please use it only if sourceName string is already sanitized.

    Parameters

    • message: string
    • sourceName: string
    • sourceLine: string
    • lineNumber: uint32_t
    • columnNumber: uint32_t
    • flags: uint32_t
    • category: string
    • innerWindowID: number
    • fromChromeContext: bool

    Returns void

  • This is the same function as initWithWindowID with an uri as a source parameter.

    Parameters

    • message: string
    • sourceURI: nsIURI
    • sourceLine: string
    • lineNumber: uint32_t
    • columnNumber: uint32_t
    • flags: uint32_t
    • category: string
    • innerWindowID: number
    • fromChromeContext: bool

    Returns void

  • This should be called instead of nsIScriptError.init to initialize with a window id. The window id should be for the inner window associated with this error.

    This function will check whether sourceName is a uri and sanitize it if needed. If you know the source name is sanitized already, use initWithSanitizedSource. A "sanitized" source name means that passwords are not shown. It will use the sensitiveInfoHiddenSpec function of nsIURI interface, that is replacing paswords with *** (e.g. https://USERNAME:****@example.com/some/path).

    Parameters

    • message: string
    • sourceName: string
    • sourceLine: string
    • lineNumber: uint32_t
    • columnNumber: uint32_t
    • flags: uint32_t
    • category: string
    • innerWindowID: number
    • fromChromeContext: bool

    Returns void

Generated using TypeDoc