Remove use of `fromString(...).join` in a few places (fixes #52)
parent
0861f0a49b
commit
c904281027
|
@ -271,7 +271,7 @@ function genericPrintNoParens(path, options, print) {
|
||||||
|
|
||||||
return concat(parts);
|
return concat(parts);
|
||||||
case "Path":
|
case "Path":
|
||||||
return fromString(".").join(n.body);
|
return join(".", n.body);
|
||||||
case "Identifier":
|
case "Identifier":
|
||||||
return concat([
|
return concat([
|
||||||
n.name,
|
n.name,
|
||||||
|
@ -376,7 +376,7 @@ function genericPrintNoParens(path, options, print) {
|
||||||
parts.push(path.call(print, "body"));
|
parts.push(path.call(print, "body"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return fromString(" ").join(parts);
|
return join(" ", parts);
|
||||||
case "ImportSpecifier":
|
case "ImportSpecifier":
|
||||||
if (n.imported) {
|
if (n.imported) {
|
||||||
parts.push(path.call(print, "imported"));
|
parts.push(path.call(print, "imported"));
|
||||||
|
@ -1037,13 +1037,9 @@ function genericPrintNoParens(path, options, print) {
|
||||||
case "JSXIdentifier":
|
case "JSXIdentifier":
|
||||||
return fromString(n.name, options);
|
return fromString(n.name, options);
|
||||||
case "JSXNamespacedName":
|
case "JSXNamespacedName":
|
||||||
return fromString(
|
return join(":", [ path.call(print, "namespace"), path.call(print, "name") ]);
|
||||||
":"
|
|
||||||
).join([ path.call(print, "namespace"), path.call(print, "name") ]);
|
|
||||||
case "JSXMemberExpression":
|
case "JSXMemberExpression":
|
||||||
return fromString(
|
return join(".", [ path.call(print, "object"), path.call(print, "property") ]);
|
||||||
"."
|
|
||||||
).join([ path.call(print, "object"), path.call(print, "property") ]);
|
|
||||||
case "JSXSpreadAttribute":
|
case "JSXSpreadAttribute":
|
||||||
return concat([ "{...", path.call(print, "argument"), "}" ]);
|
return concat([ "{...", path.call(print, "argument"), "}" ]);
|
||||||
case "JSXExpressionContainer":
|
case "JSXExpressionContainer":
|
||||||
|
@ -1857,7 +1853,7 @@ function printClass(path, print) {
|
||||||
if (n["implements"] && n["implements"].length > 0) {
|
if (n["implements"] && n["implements"].length > 0) {
|
||||||
parts.push(
|
parts.push(
|
||||||
" implements ",
|
" implements ",
|
||||||
fromString(", ").join(path.map(print, "implements"))
|
join(", ", path.map(print, "implements"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue