Bug 1371298 - stop ignoring prefs after #endif in webpack/addon devtools prefs loaders;r=tromey
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 08 Jun 2017 17:05:52 +0200
changeset 363046 5b3aef6c71b7a5acf9c5f9caa209c14140abad2e
parent 363045 f776e85cbb5881ef6f97fce55a4dc7d78a8c8583
child 363047 b418659052d26c36c9e4f0f569d5277a5643086f
push id31994
push usercbook@mozilla.com
push dateFri, 09 Jun 2017 10:56:24 +0000
treeherdermozilla-central@7c9d96bbc400 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstromey
bugs1371298
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1371298 - stop ignoring prefs after #endif in webpack/addon devtools prefs loaders;r=tromey MozReview-Commit-ID: CKlmL6S0dtX
devtools/bootstrap.js
devtools/client/inspector/webpack/prefs-loader.js
--- a/devtools/bootstrap.js
+++ b/devtools/bootstrap.js
@@ -68,16 +68,18 @@ function interpretPreprocessingInstructi
   for (let line of lines) {
     if (line.startsWith("#if")) {
       if (!(line in ifMap)) {
         throw new Error("missing line in ifMap: " + line);
       }
       ignoring = !ifMap[line];
     } else if (line.startsWith("#else")) {
       ignoring = !ignoring;
+    } else if (line.startsWith("#endif")) {
+      ignoring = false;
     }
 
     let isPrefLine = /^ *pref\("([^"]+)"/.test(line);
     if (continuation || (!ignoring && isPrefLine)) {
       newLines.push(line);
 
       // The call to pref(...); might span more than one line.
       continuation = !/\);/.test(line);
--- a/devtools/client/inspector/webpack/prefs-loader.js
+++ b/devtools/client/inspector/webpack/prefs-loader.js
@@ -52,16 +52,18 @@ module.exports = function (content) {
     if (isDevtools) {
       if (line.startsWith("#if")) {
         if (!(line in ifMap)) {
           throw new Error("missing line in ifMap: " + line);
         }
         ignoring = !ifMap[line];
       } else if (line.startsWith("#else")) {
         ignoring = !ignoring;
+      } else if (line.startsWith("#endif")) {
+        ignoring = false;
       }
     }
 
     if (continuation || (!ignoring && acceptLine(line))) {
       newLines.push(line);
 
       // The call to pref(...); might span more than one line.
       continuation = !/\);/.test(line);