Bug 1489363 - Replace some string.Assign* with AssignLiteral. r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D5224
This commit is contained in:
Mike Hommey
2018-09-07 22:12:01 +00:00
parent 34ed46a80f
commit d00117b8a3
17 changed files with 30 additions and 25 deletions

View File

@@ -100,9 +100,11 @@ SubscriptCachePath(JSContext* cx, nsIURI* uri, JS::HandleObject targetObj, nsACS
{
// StartupCache must distinguish between non-syntactic vs global when
// computing the cache key.
bool hasNonSyntacticScope = !JS_IsGlobalObject(targetObj);
cachePath.Assign(hasNonSyntacticScope ? JSSUB_CACHE_PREFIX("non-syntactic")
: JSSUB_CACHE_PREFIX("global"));
if (!JS_IsGlobalObject(targetObj)) {
cachePath.AssignLiteral(JSSUB_CACHE_PREFIX("non-syntactic"));
} else {
cachePath.AssignLiteral(JSSUB_CACHE_PREFIX("global"));
}
PathifyURI(uri, cachePath);
}