Merge pull request #4780 from mwei0210/master

check provided size to check whether to export
pull/4774/merge
Adam Cozzette 7 years ago committed by GitHub
commit e3ea413ab0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/google/protobuf/compiler/js/js_generator.cc

@ -3477,7 +3477,8 @@ void Generator::GenerateFile(const GeneratorOptions& options,
GenerateExtension(options, printer, *it);
}
if (options.import_style == GeneratorOptions::kImportCommonJs) {
// if provided is empty, do not export anything
if (options.import_style == GeneratorOptions::kImportCommonJs && !provided.empty()) {
printer->Print("goog.object.extend(exports, $package$);\n",
"package", GetFilePath(options, file));
}

Loading…
Cancel
Save