Bug 796320 (part 3) - Remove JSContext::lastMessage. r=luke.

--HG--
extra : rebase_source : efda9e940e598fc037d6d51403b95c01ba3bad4b
This commit is contained in:
Nicholas Nethercote 2012-10-02 19:13:21 -07:00
parent a0352fce84
commit daba0ca48f
2 changed files with 2 additions and 14 deletions

View File

@ -998,11 +998,6 @@ js_ReportErrorAgain(JSContext *cx, const char *message, JSErrorReport *reportp)
if (!message)
return;
if (cx->lastMessage)
js_free(cx->lastMessage);
cx->lastMessage = JS_strdup(cx, message);
if (!cx->lastMessage)
return;
onError = cx->errorReporter;
/*
@ -1011,11 +1006,11 @@ js_ReportErrorAgain(JSContext *cx, const char *message, JSErrorReport *reportp)
*/
if (onError) {
JSDebugErrorHook hook = cx->runtime->debugHooks.debugErrorHook;
if (hook && !hook(cx, cx->lastMessage, reportp, cx->runtime->debugHooks.debugErrorHookData))
if (hook && !hook(cx, message, reportp, cx->runtime->debugHooks.debugErrorHookData))
onError = NULL;
}
if (onError)
onError(cx, cx->lastMessage, reportp);
onError(cx, message, reportp);
}
void
@ -1213,7 +1208,6 @@ JSContext::JSContext(JSRuntime *rt)
stack(thisDuringConstruction()),
parseMapPool_(NULL),
cycleDetectorSet(thisDuringConstruction()),
lastMessage(NULL),
errorReporter(NULL),
operationCallback(NULL),
data(NULL),
@ -1252,9 +1246,6 @@ JSContext::~JSContext()
if (parseMapPool_)
js_delete(parseMapPool_);
if (lastMessage)
js_free(lastMessage);
JS_ASSERT(!resolvingList);
}

View File

@ -1355,9 +1355,6 @@ struct JSContext : js::ContextFriendFields
/* State for object and array toSource conversion. */
js::ObjectSet cycleDetectorSet;
/* Last message string and log file for debugging. */
char *lastMessage;
/* Per-context optional error reporter. */
JSErrorReporter errorReporter;