From 5e2a6ffe65da1fbeb61882f27f9389054af1827f Mon Sep 17 00:00:00 2001 From: Leah Lundqvist Date: Wed, 3 Jun 2020 16:30:43 +0200 Subject: [PATCH] jsgen: small fix - remove trailing comma in export --- vlib/v/gen/js/js.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vlib/v/gen/js/js.v b/vlib/v/gen/js/js.v index e857859fc7..eebbec19b6 100644 --- a/vlib/v/gen/js/js.v +++ b/vlib/v/gen/js/js.v @@ -118,8 +118,9 @@ pub fn gen(files []ast.File, table &table.Table, pref &pref.Preferences) string out += '\n\t/* module exports */' } out += '\n\treturn {' - for pub_var in g.namespaces_pub[node.name] { - out += '\n\t\t$pub_var,' + for i, pub_var in g.namespaces_pub[node.name] { + out += '\n\t\t$pub_var' + if i < g.namespaces_pub[node.name].len - 1 { out += ',' } } if g.namespaces_pub[node.name].len > 0 { out += '\n\t' } out += '};'