From 265225f703a6d94dd20d42c322233b52d73f22f8 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 6 Apr 2016 15:28:30 -0700 Subject: Fix output of initializer list metadata * Fix output of initializer list metadata Turns out trailing commas aren't valid JSON --- src/s2wasm.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/s2wasm.h b/src/s2wasm.h index c2e8c77a0..701d86f18 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -1443,7 +1443,12 @@ public: o << "\"staticBump\": " << (nextStatic - globalBase) << ", "; o << "\"initializers\": ["; - for (const auto& func : initializerFunctions) o << "\"" << func.c_str() << "\", "; + first = true; + for (const auto& func : initializerFunctions) { + if (first) first = false; + else o << ", "; + o << "\"" << func.c_str() << "\""; + } o << "]"; o << " }"; -- cgit v1.2.3