Fix a bug with expanding function args by passing group opts properly
This commit is contained in:
1 parent
fae314bee0
commit
98fef67b4e
4 files changed
+27
-18
No files matched your search
+2
-2
@@ -1775,7 +1775,7 @@ function printArgumentsList(path, options, print) {
|
||||
{ shouldBreak: true }
|
||||
),
|
||||
],
|
||||
shouldBreak
|
||||
{ shouldBreak }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1789,7 +1789,7 @@ function printArgumentsList(path, options, print) {
|
||||
softline,
|
||||
")"
|
||||
]),
|
||||
shouldBreak
|
||||
{ shouldBreak }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,9 +94,12 @@ function reduce_test() {
|
||||
return previousValue + currentValue + array[index];
|
||||
});
|
||||
|
||||
[ 0, 1, 2, 3, 4 ].reduce(function(previousValue, currentValue, index, array) {
|
||||
[ 0, 1, 2, 3, 4 ].reduce(
|
||||
function(previousValue, currentValue, index, array) {
|
||||
return previousValue + currentValue + array[index];
|
||||
}, 10);
|
||||
},
|
||||
10
|
||||
);
|
||||
|
||||
var total = [ 0, 1, 2, 3 ].reduce(function(a, b) {
|
||||
return a + b;
|
||||
|
||||
@@ -22,19 +22,22 @@ geolocation.clearWatch(id);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/* @flow */
|
||||
var geolocation = new Geolocation();
|
||||
var id = geolocation.watchPosition(position => {
|
||||
var coords: Coordinates = position.coords;
|
||||
var accuracy: number = coords.accuracy;
|
||||
}, e => {
|
||||
var message: string = e.message;
|
||||
switch (e.code) {
|
||||
case e.PERMISSION_DENIED:
|
||||
case e.POSITION_UNAVAILABLE:
|
||||
case e.TIMEOUT:
|
||||
default:
|
||||
break;
|
||||
var id = geolocation.watchPosition(
|
||||
position => {
|
||||
var coords: Coordinates = position.coords;
|
||||
var accuracy: number = coords.accuracy;
|
||||
},
|
||||
e => {
|
||||
var message: string = e.message;
|
||||
switch (e.code) {
|
||||
case e.PERMISSION_DENIED:
|
||||
case e.POSITION_UNAVAILABLE:
|
||||
case e.TIMEOUT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
geolocation.clearWatch(id);
|
||||
"
|
||||
|
||||
@@ -1461,9 +1461,12 @@ exports[`test test20.js 1`] = `
|
||||
// Array#reduce
|
||||
[ 0, 1 ].reduce((x, y, i) => y);
|
||||
|
||||
[ \"a\", \"b\" ].reduce((regex, representation, index) => {
|
||||
[ \"a\", \"b\" ].reduce(
|
||||
(regex, representation, index) => {
|
||||
return regex + ((index ? \"|\" : \"\")) + \"(\" + representation + \")\";
|
||||
}, \"\");
|
||||
},
|
||||
\"\"
|
||||
);
|
||||
|
||||
[ \"\" ].reduce((acc, str) => acc * str.length);
|
||||
"
|
||||
|
||||
Reference in new issue
Block a user