Bug 1289050 - Part 2.1: Use JS_ReportErrorLatin1 in mozJSComponentLoader::LoadModule. r=jwalden

This commit is contained in:
Tooru Fujisawa 2016-09-30 12:34:43 +09:00
parent c635ba4f34
commit f2542c1849

View File

@ -404,8 +404,12 @@ mozJSComponentLoader::LoadModule(FileLocation& aFile)
}
if (JS_TypeOfValue(cx, NSGetFactory_val) != JSTYPE_FUNCTION) {
JS_ReportError(cx, "%s has NSGetFactory property that is not a function",
spec.get());
/*
* spec's encoding is ASCII unless it's zip file, otherwise it's
* random encoding. Latin1 variant is safe for random encoding.
*/
JS_ReportErrorLatin1(cx, "%s has NSGetFactory property that is not a function",
spec.get());
return nullptr;
}