diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index 79b41f9494f6..654117651c97 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -1192,9 +1192,12 @@ ScriptSource::substring(JSContext *cx, uint32_t start, uint32_t stop) const jschar *chars; #if USE_ZLIB Rooted cached(cx, NULL); +#ifdef JS_THREADSAFE if (!ready()) { chars = cx->runtime->sourceCompressorThread.currentChars(); - } else if (compressed()) { + } else +#endif + if (compressed()) { cached = cx->runtime->sourceDataCache.lookup(this); if (!cached) { const size_t nbytes = sizeof(jschar) * (length_ + 1);