Always expand first argument if the second argument is also a call expression (#4657)
This commit is contained in:
1 parent
cb1c52ad08
commit
d013983d8a
4 files changed
+18
-1
No files matched your search
@@ -3415,6 +3415,8 @@ function shouldGroupFirstArg(args) {
|
||||
(firstArg.type === "FunctionExpression" ||
|
||||
(firstArg.type === "ArrowFunctionExpression" &&
|
||||
firstArg.body.type === "BlockStatement")) &&
|
||||
secondArg.type !== "FunctionExpression" &&
|
||||
secondArg.type !== "ArrowFunctionExpression" &&
|
||||
!couldGroupArg(secondArg)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -88,6 +88,10 @@ setTimeout(
|
||||
setTimeout(/* blip */ function() {
|
||||
thing();
|
||||
}, 500);
|
||||
|
||||
func((args) => {
|
||||
execute(args);
|
||||
}, result => result && console.log("success"))
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
setTimeout(function() {
|
||||
thing();
|
||||
@@ -200,4 +204,11 @@ setTimeout(
|
||||
500
|
||||
);
|
||||
|
||||
func(
|
||||
args => {
|
||||
execute(args);
|
||||
},
|
||||
result => result && console.log("success")
|
||||
);
|
||||
|
||||
`;
|
||||
@@ -1 +1 @@
|
||||
run_spec(__dirname, ["flow", "typescript"]);
|
||||
run_spec(__dirname, ["babylon", "flow", "typescript"]);
|
||||
@@ -85,3 +85,7 @@ setTimeout(
|
||||
setTimeout(/* blip */ function() {
|
||||
thing();
|
||||
}, 500);
|
||||
|
||||
func((args) => {
|
||||
execute(args);
|
||||
}, result => result && console.log("success"))
|
||||
Reference in new issue
Block a user