Bug 1283855 part 22 - Make GetErrorTypeName take JSContext instead of JSRuntime. r=arai

--HG--
extra : rebase_source : b8fee2c303140257fdae29ea709a94a99fc6739d
This commit is contained in:
Jan de Mooij 2016-07-05 16:49:48 +02:00
Родитель e4ae5f26da
Коммит 95d24f32ab
4 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -510,7 +510,7 @@ ErrorObject::createConstructor(JSContext* cx, JSProtoKey key)
}
JS_FRIEND_API(JSFlatString*)
js::GetErrorTypeName(JSRuntime* rt, int16_t exnType)
js::GetErrorTypeName(JSContext* cx, int16_t exnType)
{
/*
* JSEXN_INTERNALERR returns null to prevent that "InternalError: "
@ -522,7 +522,7 @@ js::GetErrorTypeName(JSRuntime* rt, int16_t exnType)
return nullptr;
}
JSProtoKey key = GetExceptionProtoKey(JSExnType(exnType));
return ClassName(key, rt->contextFromMainThread());
return ClassName(key, cx);
}
void

Просмотреть файл

@ -1155,7 +1155,7 @@ CastToJSFreeOp(FreeOp* fop)
* Returns nullptr for invalid arguments and JSEXN_INTERNALERR
*/
extern JS_FRIEND_API(JSFlatString*)
GetErrorTypeName(JSRuntime* rt, int16_t exnType);
GetErrorTypeName(JSContext* cx, int16_t exnType);
#ifdef JS_DEBUG
extern JS_FRIEND_API(unsigned)

Просмотреть файл

@ -5873,7 +5873,7 @@ CreateLastWarningObject(JSContext* cx, JSErrorReport* report)
if (report->exnType == JSEXN_WARN)
nameStr = JS_NewStringCopyZ(cx, "Warning");
else
nameStr = GetErrorTypeName(cx->runtime(), report->exnType);
nameStr = GetErrorTypeName(cx, report->exnType);
if (!nameStr)
return false;
RootedValue nameVal(cx, StringValue(nameStr));

Просмотреть файл

@ -293,7 +293,7 @@ xpc::ErrorReport::ErrorReportToMessageString(JSErrorReport* aReport,
aString.Truncate();
const char16_t* m = aReport->ucmessage;
if (m) {
JSFlatString* name = js::GetErrorTypeName(CycleCollectedJSRuntime::Get()->Runtime(), aReport->exnType);
JSFlatString* name = js::GetErrorTypeName(CycleCollectedJSRuntime::Get()->Context(), aReport->exnType);
if (name) {
AssignJSFlatString(aString, name);
aString.AppendLiteral(": ");