Inline do expressions inside of JSX (#3607)

Fixes #3602
This commit is contained in:
Christopher Chedeau authored and Lucas Duailibe committed 2017-12-29 18:58:01 -03:00
1 parent cfb8987ecd
commit 7eca8011bc
4 files changed
+23

No files matched your search

+1
View File
@@ -1691,6 +1691,7 @@ function printPathNoParens(path, options, print, args) {
n.expression.type === "JSXEmptyExpression" ||
n.expression.type === "TemplateLiteral" ||
n.expression.type === "TaggedTemplateExpression" ||
n.expression.type === "DoExpression" ||
(isJSXNode(parent) &&
(n.expression.type === "ConditionalExpression" ||
isBinaryish(n.expression))));
@@ -0,0 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`do.js 1`] = `
<div>
{do {
1
}}
</div>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div>
{do {
1;
}}
</div>;
`;
+5
View File
@@ -0,0 +1,5 @@
<div>
{do {
1
}}
</div>
+1
View File
@@ -0,0 +1 @@
run_spec(__dirname, ["babylon"]);