diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index 56d402f0e085..e5fcb38f1744 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -715,10 +715,16 @@ mozJSComponentLoader::ObjectForLocation(ComponentLoaderInfo& aInfo, // The script wasn't in the cache , so compile it now. LOG(("Slow loading %s\n", nativePath.get())); + // Note - if mReuseLoaderGlobal is true, then we can't do lazy source, + // because we compile things as functions (rather than script), and lazy + // source isn't supported in that configuration. That's ok though, + // because we only do mReuseLoaderGlobal on b2g, where we invoke + // setDiscardSource(true) on the entire global. CompileOptions options(cx); options.setNoScriptRval(mReuseLoaderGlobal ? false : true) .setVersion(JSVERSION_LATEST) - .setFileAndLine(nativePath.get(), 1); + .setFileAndLine(nativePath.get(), 1) + .setSourceIsLazy(!mReuseLoaderGlobal); if (realFile) { #ifdef HAVE_PR_MEMMAP