Bug 1417844 part 3 - Remove JSVersion from subscript cache path. r=kmag

This commit is contained in:
Jan de Mooij 2017-11-17 12:13:15 +01:00
Родитель 7f30bf48a7
Коммит 2e7986aee1
1 изменённых файлов: 2 добавлений и 4 удалений

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

@ -94,13 +94,11 @@ NS_IMPL_ISUPPORTS(mozJSSubScriptLoader, mozIJSSubScriptLoader)
static void
SubscriptCachePath(JSContext* cx, nsIURI* uri, JS::HandleObject targetObj, nsACString& cachePath)
{
// StartupCache must distinguish between non-syntactic vs global, as well as
// javascript version when computing the cache key.
// StartupCache must distinguish between non-syntactic vs global when
// computing the cache key.
bool hasNonSyntacticScope = !JS_IsGlobalObject(targetObj);
JSVersion version = JS_GetVersion(cx);
cachePath.Assign(hasNonSyntacticScope ? JSSUB_CACHE_PREFIX("non-syntactic")
: JSSUB_CACHE_PREFIX("global"));
cachePath.AppendPrintf("/%d", version);
PathifyURI(uri, cachePath);
}