[SM91] Update to Spidermonkey 91.1.3 APIs
[0ad.git] / libraries / source / spidermonkey / include-win32-release / js / friend / ErrorMessages.h
blob1615c8e052fe014bff2a542180f57516ad4ded4f
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /*
8 * SpiderMonkey internal error numbering and error-formatting functionality
9 * (also for warnings).
11 * This functionality is moderately stable. JSErrNum and js::GetErrorMessage
12 * are widely used inside SpiderMonkey, and Gecko uses them to produce errors
13 * identical to those SpiderMonkey itself would produce, in various situations.
14 * However, the set of error numbers is not stable, error number values are not
15 * stable, error types are not stable, etc. Use your own error reporting code
16 * if you can.
19 #ifndef js_friend_ErrorMessages_h
20 #define js_friend_ErrorMessages_h
22 #include "jstypes.h" // JS_PUBLIC_API
24 struct JSErrorFormatString;
26 enum JSErrNum {
27 #define MSG_DEF(name, count, exception, format) name,
28 #include "js/friend/ErrorNumbers.msg"
29 #undef MSG_DEF
30 JSErr_Limit
33 namespace js {
35 /**
36 * A JSErrorCallback suitable for passing to |JS_ReportErrorNumberASCII| and
37 * similar functions in concert with one of the |JSErrNum| error numbers.
39 * This function is a function only of |errorNumber|: |userRef| and ambient
40 * state have no effect on its behavior.
42 extern JS_PUBLIC_API const JSErrorFormatString* GetErrorMessage(
43 void* userRef, unsigned errorNumber);
45 } // namespace js
47 #endif // js_friend_ErrorMessages_h