Bug 1394556: Part 2 - Compile all JSM/module scripts in strict mode. r?ehsan
MozReview-Commit-ID: 5BLvaHEFCqv
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -646,16 +646,17 @@ mozJSComponentLoader::ObjectForLocation(
// startup cache regresses installer size (due to source code stored in
// XDR encoded modules in omni.ja). Also, XDR decoding is relatively
// fast. When we're not using the startup cache, we want to use non-lazy
// source code so that we can use lazy parsing.
// See bug 1303754.
CompileOptions options(cx);
options.setNoScriptRval(true)
.setVersion(JSVERSION_DEFAULT)
+ .maybeMakeStrictMode(true)
.setFileAndLine(nativePath.get(), 1)
.setSourceIsLazy(cache || ScriptPreloader::GetSingleton().Active());
if (realFile) {
AutoMemMap map;
MOZ_TRY(map.init(aComponentFile));
// Note: exceptions will get handled further down;