diff --git a/src/google/protobuf/compiler/js/js_generator.cc b/src/google/protobuf/compiler/js/js_generator.cc index 71e9ba888994e..fd0367bc1221d 100644 --- a/src/google/protobuf/compiler/js/js_generator.cc +++ b/src/google/protobuf/compiler/js/js_generator.cc @@ -2272,7 +2272,7 @@ void Generator::GenerateClassToObject(const GeneratorOptions& options, " * @suppress {unusedLocalVariables} f is only used for nested messages\n" " */\n" "$classname$.toObject = function(includeInstance, msg) {\n" - " var obj = {", + " var f, obj = {", "classname", GetMessagePath(options, desc)); bool first = true;