Bug 1394556: Part 2 - Compile all JSM/module scripts in strict mode. r?ehsan draft
authorKris Maglione <maglione.k@gmail.com>
Mon, 28 Aug 2017 11:39:06 -0700
changeset 654446 8f07523cdc55622cae6884d624e193d957029e68
parent 654445 9af63b28dcc3b0967385b8e455457252d0f99f9a
child 728581 db2294eaa21472d75cd5a013f309dac856c8af8d
push id76592
push usermaglione.k@gmail.com
push dateMon, 28 Aug 2017 22:11:35 +0000
reviewersehsan
bugs1394556
milestone57.0a1
Bug 1394556: Part 2 - Compile all JSM/module scripts in strict mode. r?ehsan MozReview-Commit-ID: 5BLvaHEFCqv
js/xpconnect/loader/mozJSComponentLoader.cpp
--- 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;