jsgen: small fix - remove trailing comma in export

pull/5200/head
Leah Lundqvist 2020-06-03 16:30:43 +02:00 committed by GitHub
parent 8a23cfc0d6
commit 5e2a6ffe65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -118,8 +118,9 @@ pub fn gen(files []ast.File, table &table.Table, pref &pref.Preferences) string
out += '\n\t/* module exports */' out += '\n\t/* module exports */'
} }
out += '\n\treturn {' out += '\n\treturn {'
for pub_var in g.namespaces_pub[node.name] { for i, pub_var in g.namespaces_pub[node.name] {
out += '\n\t\t$pub_var,' 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' } if g.namespaces_pub[node.name].len > 0 { out += '\n\t' }
out += '};' out += '};'