check provided size

This commit is contained in:
ming 2018-06-19 07:20:31 +08:00
parent 8af87de949
commit 9bfed46c41

View File

@ -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.size()) {
printer->Print("goog.object.extend(exports, $package$);\n",
"package", GetFilePath(options, file));
}