parent
c63e21b52b
commit
bb232d48a3
|
@ -196,6 +196,7 @@ function genericPrintNoParens(path, options, print, args) {
|
|||
case "BinaryExpression":
|
||||
case "LogicalExpression": {
|
||||
const parent = path.getParentNode();
|
||||
const parentParent = path.getParentNode(1);
|
||||
const isInsideParenthesis =
|
||||
n !== parent.body &&
|
||||
(parent.type === "IfStatement" ||
|
||||
|
@ -230,6 +231,8 @@ function genericPrintNoParens(path, options, print, args) {
|
|||
parent.type === "VariableDeclarator" ||
|
||||
shouldInlineLogicalExpression(n) ||
|
||||
parent.type === "ReturnStatement" ||
|
||||
(parent.type === "JSXExpressionContainer" &&
|
||||
parentParent.type === "JSXAttribute") ||
|
||||
(n === parent.body && parent.type === "ArrowFunctionExpression") ||
|
||||
(n !== parent.body && parent.type === "ForStatement")
|
||||
) {
|
||||
|
|
|
@ -120,6 +120,37 @@ this.steps = steps || [
|
|||
|
||||
`;
|
||||
|
||||
exports[`jsx_parent.js 1`] = `
|
||||
<div
|
||||
src={
|
||||
!isJellyfishEnabled &&
|
||||
diffUpdateMessageInput != null &&
|
||||
this.state.isUpdateMessageEmpty
|
||||
}
|
||||
/>;
|
||||
|
||||
<div>
|
||||
{!isJellyfishEnabled &&
|
||||
diffUpdateMessageInput != null &&
|
||||
this.state.isUpdateMessageEmpty}
|
||||
</div>;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<div
|
||||
src={
|
||||
!isJellyfishEnabled &&
|
||||
diffUpdateMessageInput != null &&
|
||||
this.state.isUpdateMessageEmpty
|
||||
}
|
||||
/>;
|
||||
|
||||
<div>
|
||||
{!isJellyfishEnabled &&
|
||||
diffUpdateMessageInput != null &&
|
||||
this.state.isUpdateMessageEmpty}
|
||||
</div>;
|
||||
|
||||
`;
|
||||
|
||||
exports[`short-right.js 1`] = `
|
||||
this._cumulativeHeights &&
|
||||
Math.abs(
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<div
|
||||
src={
|
||||
!isJellyfishEnabled &&
|
||||
diffUpdateMessageInput != null &&
|
||||
this.state.isUpdateMessageEmpty
|
||||
}
|
||||
/>;
|
||||
|
||||
<div>
|
||||
{!isJellyfishEnabled &&
|
||||
diffUpdateMessageInput != null &&
|
||||
this.state.isUpdateMessageEmpty}
|
||||
</div>;
|
|
@ -118,12 +118,12 @@ exports[`expression.js 1`] = `
|
|||
key={option}
|
||||
imageSource={
|
||||
this.props.veryBigItemImageSourceFunc &&
|
||||
this.props.veryBigItemImageSourceFunc(option)
|
||||
this.props.veryBigItemImageSourceFunc(option)
|
||||
}
|
||||
imageSize={this.props.veryBigItemImageSize}
|
||||
imageView={
|
||||
this.props.veryBigItemImageViewFunc &&
|
||||
this.props.veryBigItemImageViewFunc(option)
|
||||
this.props.veryBigItemImageViewFunc(option)
|
||||
}
|
||||
heading={this.props.displayTextFunc(option)}
|
||||
value={option}
|
||||
|
|
Loading…
Reference in New Issue