зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1283855
part 22 - Make GetErrorTypeName take JSContext instead of JSRuntime. r=arai
--HG-- extra : rebase_source : b8fee2c303140257fdae29ea709a94a99fc6739d
This commit is contained in:
Родитель
e4ae5f26da
Коммит
95d24f32ab
|
@ -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(": ");
|
||||
|
|
Загрузка…
Ссылка в новой задаче