Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/scriptinterface/ScriptExceptions.h
Show All 33 Lines | |||||
* JS script (or anything that can throw JS errors, such as structured clones), | * JS script (or anything that can throw JS errors, such as structured clones), | ||||
* in case that script doesn't catch an exception thrown during its execution. | * in case that script doesn't catch an exception thrown during its execution. | ||||
* If no exception is pending, this does nothing. | * If no exception is pending, this does nothing. | ||||
* Note that JS code that wants to throw errors should throw new Error(...), otherwise the stack cannot be used. | * Note that JS code that wants to throw errors should throw new Error(...), otherwise the stack cannot be used. | ||||
* @return Whether there was a pending exception. | * @return Whether there was a pending exception. | ||||
*/ | */ | ||||
bool CatchPending(const ScriptRequest& rq); | bool CatchPending(const ScriptRequest& rq); | ||||
void ErrorReporter(JSContext* rt, const char* message, JSErrorReport* report); | |||||
/** | /** | ||||
* Raise a JS exception from C++ code. | * Raise a JS exception from C++ code. | ||||
* This is only really relevant in JSNative functions that don't use ObjectOpResult, | * This is only really relevant in JSNative functions that don't use ObjectOpResult, | ||||
* as the latter overwrites the pending exception. | * as the latter overwrites the pending exception. | ||||
* Prefer either simply logging an error if you know a stack-trace will be raised elsewhere. | * Prefer either simply logging an error if you know a stack-trace will be raised elsewhere. | ||||
*/ | */ | ||||
void Raise(const ScriptRequest& rq, const char* format, ...); | void Raise(const ScriptRequest& rq, const char* format, ...); | ||||
} | } | ||||
#endif // INCLUDED_SCRIPTEXCEPTIONS | #endif // INCLUDED_SCRIPTEXCEPTIONS |
Wildfire Games · Phabricator