Merge branch 'master' into 7.0

This commit is contained in:
Henry Zhu
2017-02-28 14:37:13 -05:00
30 changed files with 1931 additions and 973 deletions

View File

@@ -944,14 +944,14 @@ export default function (instance) {
});
instance.extend("parseParenItem", function (inner) {
return function (node, startLoc, startPos) {
node = inner.call(this, node, startLoc, startPos);
return function (node, startPos, startLoc) {
node = inner.call(this, node, startPos, startLoc);
if (this.eat(tt.question)) {
node.optional = true;
}
if (this.match(tt.colon)) {
const typeCastNode = this.startNodeAt(startLoc, startPos);
const typeCastNode = this.startNodeAt(startPos, startLoc);
typeCastNode.expression = node;
typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();