Add parenthesis around sequences in arrow bodies
This commit is contained in:
parent
e6092bcf39
commit
fd38acae43
|
|
@ -597,6 +597,7 @@ function OutputStream(options) {
|
|||
|| p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2
|
||||
|| p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30)
|
||||
* ==> 20 (side effect, set a := 10 and b := 20) */
|
||||
|| p instanceof AST_Arrow // x => (x, x)
|
||||
;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -396,6 +396,9 @@ fat_arrow_as_param: {
|
|||
input: {
|
||||
foo(x => x);
|
||||
foo(x => x, y => y);
|
||||
|
||||
foo(x => (x, x));
|
||||
foo(x => (x, x), y => (y, y));
|
||||
}
|
||||
expect_exact: "foo(x=>x);foo(x=>x,y=>y);"
|
||||
expect_exact: "foo(x=>x);foo(x=>x,y=>y);foo(x=>(x,x));foo(x=>(x,x),y=>(y,y));"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user