How to use the google-closure-compiler.gjd function in google-closure-compiler

To help you get started, we’ve selected a few google-closure-compiler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bolinfest / plovr / closure-deps / lib / parser.js View on Github external
/**
   * @param {boolean} fatal
   * @param {string} message
   * @param {string} sourceName
   * @param {number} line
   * @param {number} lineOffset
   */
  function report(fatal, message, sourceName, line, lineOffset) {
    errors.push(new ParseError(fatal, message, sourceName, line, lineOffset));
  }

  if (isDepFile(text)) {
    return parseDependencyFile(text, filePath, report);
  }

  const data = gjd(text, filePath, report);

  if (errors.some(e => e.fatal)) {
    return new ParseResult(
        [new depGraph.Dependency(
            depGraph.DependencyType.SCRIPT, filePath, [], [])],
        errors, ParseResult.Source.SOURCE_FILE);
  }

  function getLoadFlag(key, defaultValue) {
    if (data.load_flags) {
      for (const [k, v] of data.load_flags) {
        if (key === k) {
          return v;
        }
      }
    }