From c1bb25e41202046c15a5840dd8874f52099f2413 Mon Sep 17 00:00:00 2001 From: Eric Miller Date: Thu, 18 Apr 2024 16:58:18 -0700 Subject: [PATCH] (minor) fix indentation in toObject function This fixes a very minor aesthetic regression associated with newer protobuf versions https://github.com/protocolbuffers/protobuf-javascript/pull/196 Apparently the behavior of printer->Print has changed subtly in how it strips leading spaces. --- generator/js_generator.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generator/js_generator.cc b/generator/js_generator.cc index d6fad0a..3cfbdfd 100644 --- a/generator/js_generator.cc +++ b/generator/js_generator.cc @@ -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; }