Skip to content

Commit

Permalink
(minor) fix indentation in toObject function
Browse files Browse the repository at this point in the history
This fixes a very minor aesthetic regression associated with newer protobuf versions
protocolbuffers#196

Apparently the behavior of printer->Print has changed subtly in how it strips leading spaces.
  • Loading branch information
eric-skydio committed Apr 19, 2024
1 parent 1976603 commit c1bb25e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions generator/js_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2216,10 +2216,11 @@ void Generator::GenerateClassToObject(const GeneratorOptions& options,
continue;
}

auto indent = printer->WithIndent(4);
if (!first) {
printer->Print(",\n ");
printer->Emit(",\n");
} else {
printer->Print("\n ");
printer->Emit("\n");
first = false;
}

Expand Down

0 comments on commit c1bb25e

Please sign in to comment.