From 49f2443338c00931d2f30f9d8c1706398bd5cb34 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 11 Jun 2020 16:18:54 -0700 Subject: Move optional metadata field so its not last (#2909) To avoid the conditional trailing comma. --- src/wasm/wasm-emscripten.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/wasm/wasm-emscripten.cpp') diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp index a57573254..4a8f2c0c3 100644 --- a/src/wasm/wasm-emscripten.cpp +++ b/src/wasm/wasm-emscripten.cpp @@ -1217,13 +1217,6 @@ std::string EmscriptenGlueGenerator::generateEmscriptenMetadata( }); meta << "\n ],\n"; - meta << " \"features\": ["; - commaFirst = true; - wasm.features.iterFeatures([&](FeatureSet::Feature f) { - meta << nextElement() << "\"--enable-" << FeatureSet::toString(f) << '"'; - }); - meta << "\n ],\n"; - // In normal mode we attempt to determine if main takes argumnts or not // In standalone mode we export _start instead and rely on the presence // of the __wasi_args_get and __wasi_args_sizes_get syscalls allow us to @@ -1247,9 +1240,16 @@ std::string EmscriptenGlueGenerator::generateEmscriptenMetadata( } } } - meta << " \"mainReadsParams\": " << int(mainReadsParams) << '\n'; + meta << " \"mainReadsParams\": " << int(mainReadsParams) << ",\n"; } + meta << " \"features\": ["; + commaFirst = true; + wasm.features.iterFeatures([&](FeatureSet::Feature f) { + meta << nextElement() << "\"--enable-" << FeatureSet::toString(f) << '"'; + }); + meta << "\n ]\n"; + meta << "}\n"; return meta.str(); -- cgit v1.2.3