mozilla
Your Search Results

    NS_ASSERTION

    この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

     

    Summary

    Macro

    Throws an assertion failure if the first macro argument does not evaluate to true. In a debug build the failure text is written to console (stderr), into the NSPR debug log, and on Windows a dialog box is opened. The behavior of an assertion failure can be controlled using the XPCOM_DEBUG_BREAK environment variable.

    An assertion failure should be thrown on critical program errors only. A triggered assertion failure is equivalent to crashing in Tinderbox tests.

    Note on terminology: "assertion" is the condition to test. There is always an assertion in NS_ASSERTION; it is the first argument. Only if the assertion evaluates to false is there an "assertion failure", which is thrown. The phrase "throwing an assertion" makes no sense.

    Syntax

    NS_ASSERTION(expressionToTest, "error text");
    

    See also

    ドキュメントのタグと貢献者

    タグ: 
    Contributors to this page: Sheppy, Allanbonadio, Nickolay, Waldo, Editmonkey, Biesi, Jorend
    最終更新者: Waldo,