Support type annotation for rest argument on babylon parser

This is working on the flow parser but not babylon

```js
echo 'function f(...flags: Array<boolean>) {}' | ./bin/prettier.js --stdin
function f(...flags: Array<boolean>) {}
```
master
Christopher Chedeau 2017-01-11 15:05:28 -08:00
parent be6e92f064
commit 35fb28bef2
1 changed files with 5 additions and 1 deletions

View File

@ -287,7 +287,11 @@ function genericPrintNoParens(path, options, print) {
case "SpreadProperty":
case "SpreadPropertyPattern":
case "RestElement":
return concat([ "...", path.call(print, "argument") ]);
return concat([
"...",
path.call(print, "argument"),
path.call(print, "typeAnnotation")
]);
case "FunctionDeclaration":
case "FunctionExpression":
if (n.async)