nsIScriptError2 编辑

js/src/xpconnect/idl/nsIScriptError.idlScriptable Represents JavaScript errors and warnings for use by the console service; augments nsIScriptError by adding a way to initialize the error with the window ID of the outer window with which the error is associated. 1.0 66 Introduced Gecko 2.0 Obsolete Gecko 12.0 Inherits from: nsIScriptError Last changed in Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)

 

In Gecko 12.0 this Interface was merged into the nsIScriptError interface.

 

Method overview

void initWithWindowID(in wstring message, in wstring sourceName, in wstring sourceLine, in PRUint32 lineNumber, in PRUint32 columnNumber, in PRUint32 flags, in string category, in unsigned long long innerWindowID);

Attributes

AttributeTypeDescription
innerWindowIDunsigned long longThe inner window ID with which the error is associated. This is zero if the error was initialized by calling nsIScriptError.init() instead of initWithWindowID(). Read only.
outerWindowIDunsigned long longThe window ID with which the error is associated. This is zero if the error was initialized by calling nsIScriptError.init() instead of initWithWindowID(). Read only.
timeStamplong longElapsed time, in milliseconds, from a platform-specific zero time to the time the message was created. Read only.

Methods

initWithWindowID()

void init(
  in wstring message,
  in wstring sourceName,
  in wstring sourceLine,
  in PRUint32 lineNumber,
  in PRUint32 columnNumber,
  in PRUint32 flags,
  in string category,
  in unsigned long long innerWindowID
);
Parameters
message
The text of the message to add to the log.
sourceName
The URL of the file in which the error occurred. This will be a hyperlink in the JavaScript Console, so you should use a real URL. You may pass null if it's not applicable.
sourceLine
The line number in the source file on which the error occurred. You are responsible for providing that line. You may pass null if you are lazy; that will prevent showing the source line in JavaScript Console.
lineNumber
The number of the line where the error occurred.
columnNumber
The column number where the error occurred. This is used to draw an arrow pointing to the problem character.
flags
One of the script error flag constants.
category
A string indicating what kind of code caused the message. There are quite a few category strings and they don't seem to be listed in a single place. See Categories for a partial list.
innerWindowID
The ID of the inner window associated with the error. Prior to Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6), this was the outer window ID.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:25 次

字数:5844

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文