function checkAllDevToolsFiles() {
  const errors = [];
  const excludedFiles = ['InspectorBackendCommands.js', 'SupportedCSSProperties.js', 'ARIAProperties.js'];
  const gnVariable = 'all_devtools_files';
  const lines = selectGNLines(`${gnVariable} = [`, ']');
  if (!lines.length) {
    return [
      'Could not identify all_devtools_files list in gn file',
      'Please look at: ' + __filename,
    ];
  }
  const gnFiles = new Set(lines);
  var moduleFiles = [];
  fs.readdirSync(FRONTEND_PATH).forEach(function(moduleName) {
    const moduleJSONPath = path.join(FRONTEND_PATH, moduleName, 'module.json');
    if (utils.isFile(moduleJSONPath)) {
      const moduleJSON = require(moduleJSONPath);
      const scripts = moduleJSON.scripts || [];
      const resources = moduleJSON.resources || [];
      const files = scripts.concat(resources)
                        .map(relativePathFromBuildGN)
                        .filter(file => excludedFiles.every(excludedFile => !file.includes(excludedFile)));
      moduleFiles = moduleFiles.concat(files);

      function relativePathFromBuildGN(filename) {
        const relativePath = path.normalize(`front_end/${moduleName}/${filename}`);
        return `"${relativePath}",`;
      }
    }
  });
  for (const file of moduleFiles) {
    if (!gnFiles.has(file))
      errors.push(`Missing file in BUILD.gn for ${gnVariable}: ` + file);
  }
  return errors;
}
/**
 * Ensures that all source files (according to the various module.json files) are
 * listed in BUILD.gn.
 */
Ensures that all source files (according to the various module.json files) are
listed in BUILD.gn.
Ensures that all source files ( according to the various module . json files ) are listed in BUILD . gn .
function checkAllDevToolsFiles() {
  const errors = [];
  const excludedFiles = ['InspectorBackendCommands.js', 'SupportedCSSProperties.js', 'ARIAProperties.js'];
  const gnVariable = 'all_devtools_files';
  const lines = selectGNLines(`${gnVariable} = [`, ']');
  if (!lines.length) {
    return [
      'Could not identify all_devtools_files list in gn file',
      'Please look at: ' + __filename,
    ];
  }
  const gnFiles = new Set(lines);
  var moduleFiles = [];
  fs.readdirSync(FRONTEND_PATH).forEach(function(moduleName) {
    const moduleJSONPath = path.join(FRONTEND_PATH, moduleName, 'module.json');
    if (utils.isFile(moduleJSONPath)) {
      const moduleJSON = require(moduleJSONPath);
      const scripts = moduleJSON.scripts || [];
      const resources = moduleJSON.resources || [];
      const files = scripts.concat(resources)
                        .map(relativePathFromBuildGN)
                        .filter(file => excludedFiles.every(excludedFile => !file.includes(excludedFile)));
      moduleFiles = moduleFiles.concat(files);
      function relativePathFromBuildGN(filename) {
        const relativePath = path.normalize(`front_end/${moduleName}/${filename}`);
        return `"${relativePath}",`;
      }
    }
  });
  for (const file of moduleFiles) {
    if (!gnFiles.has(file))
      errors.push(`Missing file in BUILD.gn for ${gnVariable}: ` + file);
  }
  return errors;
}
function checkAllDevToolsFiles ( ) { const errors = [ ] ; const excludedFiles = [ 'InspectorBackendCommands.js' , 'SupportedCSSProperties.js' , 'ARIAProperties.js' ] ; const gnVariable = 'all_devtools_files' ; const lines = selectGNLines ( ` ${ gnVariable } ` , ']' ) ; if ( ! lines . length ) { return [ 'Could not identify all_devtools_files list in gn file' , 'Please look at: ' + __filename , ] ; } const gnFiles = new Set ( lines ) ; var moduleFiles = [ ] ; fs . readdirSync ( FRONTEND_PATH ) . forEach ( function ( moduleName ) { const moduleJSONPath = path . join ( FRONTEND_PATH , moduleName , 'module.json' ) ; if ( utils . isFile ( moduleJSONPath ) ) { const moduleJSON = require ( moduleJSONPath ) ; const scripts = moduleJSON . scripts || [ ] ; const resources = moduleJSON . resources || [ ] ; const files = scripts . concat ( resources ) . map ( relativePathFromBuildGN ) . filter ( file => excludedFiles . every ( excludedFile => ! file . includes ( excludedFile ) ) ) ; moduleFiles = moduleFiles . concat ( files ) ; function relativePathFromBuildGN ( filename ) { const relativePath = path . normalize ( ` ${ moduleName } ${ filename } ` ) ; return ` ${ relativePath } ` ; } } } ) ; for ( const file of moduleFiles ) { if ( ! gnFiles . has ( file ) ) errors . push ( ` ${ gnVariable } ` + file ) ; } return errors ; }
Ensures that all source files (according to the various module.json files) are
 listed in BUILD.gn.
Ensures that all source files ( according to the various module . json files ) are listed in BUILD . gn .