Skip to content

Commit ea27422

Browse files
committed
Fix usegroup; it should use "," instead of ";"
1 parent d88b09a commit ea27422

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

node_translators/usegroup.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@
55
* Usage declaration
66
*/
77
module.exports = function (node, indent) {
8-
var str = 'use' + this.ws, items = [], glue;
8+
var str = 'use' + this.ws, items, glue;
99
if (node.type) {
1010
str += node.type + this.ws;
1111
}
12-
node.items.forEach(function (item) {
12+
13+
items = (node.items || []).map(function (item) {
1314
var useItem = item.name;
1415
if (item.alias) {
1516
useItem += ' as ' + item.alias;
1617
}
17-
useItem += ';';
18-
items.push(useItem);
18+
return useItem;
1919
});
20+
2021
if (node.items.length > 1) {
2122
glue = this.nl + indent + this.indent;
2223
str += node.name + this.ws + '{' + glue;
23-
str += items.join(glue) + this.nl;
24+
str += items.join(',' + glue) + this.nl;
2425
str += indent + '};' + this.nl;
2526
} else {
26-
str += items[0] + this.nl;
27+
str += items[0] + ';' + this.nl;
2728
}
2829
return str;
2930
};

0 commit comments

Comments
 (0)