зеркало из https://github.com/mozilla/gecko-dev.git
Bug 677079 - Part i: Expose errorReporter in jsapi.h; r=mrbkap
This commit is contained in:
Родитель
2cedc161bf
Коммит
3572f908c9
|
@ -6281,6 +6281,12 @@ JS_ReportAllocationOverflow(JSContext *cx)
|
|||
js_ReportAllocationOverflow(cx);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSErrorReporter)
|
||||
JS_GetErrorReporter(JSContext *cx)
|
||||
{
|
||||
return cx->errorReporter;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSErrorReporter)
|
||||
JS_SetErrorReporter(JSContext *cx, JSErrorReporter er)
|
||||
{
|
||||
|
|
|
@ -5130,6 +5130,8 @@ struct JSErrorReport {
|
|||
#define JSREPORT_IS_STRICT(flags) (((flags) & JSREPORT_STRICT) != 0)
|
||||
#define JSREPORT_IS_STRICT_MODE_ERROR(flags) (((flags) & \
|
||||
JSREPORT_STRICT_MODE_ERROR) != 0)
|
||||
extern JS_PUBLIC_API(JSErrorReporter)
|
||||
JS_GetErrorReporter(JSContext *cx);
|
||||
|
||||
extern JS_PUBLIC_API(JSErrorReporter)
|
||||
JS_SetErrorReporter(JSContext *cx, JSErrorReporter er);
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include "AccessCheck.h"
|
||||
#include "nsJSUtils.h"
|
||||
|
||||
#include "jscntxt.h" // mJSContext->errorReporter, js::AutoValueVector
|
||||
#include "jscntxt.h" // js::AutoValueVector
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsXPCWrappedJSClass, nsIXPCWrappedJSClass)
|
||||
|
||||
|
@ -64,7 +64,7 @@ bool AutoScriptEvaluate::StartEvaluating(JSObject *scope, JSErrorReporter errorR
|
|||
return true;
|
||||
|
||||
mEvaluated = true;
|
||||
if (!mJSContext->errorReporter) {
|
||||
if (!JS_GetErrorReporter(mJSContext)) {
|
||||
JS_SetErrorReporter(mJSContext, errorReporter);
|
||||
mErrorReporterSet = true;
|
||||
}
|
||||
|
@ -1057,7 +1057,7 @@ nsXPCWrappedJSClass::CheckForException(XPCCallContext & ccx,
|
|||
// Try to use the error reporter set on the context to handle this
|
||||
// error if it came from a JS exception.
|
||||
if (reportable && is_js_exception &&
|
||||
cx->errorReporter != xpcWrappedJSErrorReporter) {
|
||||
JS_GetErrorReporter(cx) != xpcWrappedJSErrorReporter) {
|
||||
reportable = !JS_ReportPendingException(cx);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче