Browse Source

Merge pull request #4903 from BSBandme/fix_js_build

fix commonjs js provide GOOGLE_CHECK
Yilun Chong 7 years ago
parent
commit
f21d4d6830
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/google/protobuf/compiler/js/js_generator.cc

+ 1 - 1
src/google/protobuf/compiler/js/js_generator.cc

@@ -1681,7 +1681,7 @@ void Generator::GenerateProvides(const GeneratorOptions& options,
       if (options.import_style == GeneratorOptions::kImportCommonJsStrict) {
         string namespaceObject = *it;
         // Remove "proto." from the namespace object
-        GOOGLE_CHECK(namespaceObject.compare(0, 6, "proto."));
+        GOOGLE_CHECK(namespaceObject.compare(0, 6, "proto.") == 0);
         namespaceObject.erase(0, 6);
         printer->Print("goog.exportSymbol('$name$', null, proto);\n", "name",
                 namespaceObject);