Fix running flow on travis and update flow (#9128)
* Fix running flow on travis and update flow - ensure bootstrap is run before running flow as we need some generated files for correctly doing typechecks - ensure that we only ignore the build directory inside the babel folder as currently we ignore everything because travis checks out into ‘/home/travis/build/’ * Fix all flow errors
This commit is contained in:
@@ -1759,7 +1759,7 @@ export default class ExpressionParser extends LValParser {
|
||||
parseArrowExpression(
|
||||
node: N.ArrowFunctionExpression,
|
||||
params?: ?(N.Expression[]),
|
||||
isAsync?: boolean,
|
||||
isAsync?: boolean = false,
|
||||
): N.ArrowFunctionExpression {
|
||||
// if we got there, it's no more "yield in possible arrow parameters";
|
||||
// it's just "yield in arrow parameters"
|
||||
|
||||
@@ -896,9 +896,9 @@ export default class StatementParser extends ExpressionParser {
|
||||
parseFunction<T: N.NormalFunction>(
|
||||
node: T,
|
||||
isStatement: boolean,
|
||||
allowExpressionBody?: boolean,
|
||||
isAsync?: boolean,
|
||||
optionalId?: boolean,
|
||||
allowExpressionBody?: boolean = false,
|
||||
isAsync?: boolean = false,
|
||||
optionalId?: boolean = false,
|
||||
): T {
|
||||
const oldInFunc = this.state.inFunction;
|
||||
const oldInMethod = this.state.inMethod;
|
||||
|
||||
@@ -300,7 +300,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
|
||||
if (node) {
|
||||
node.type = "Property";
|
||||
if (node.kind === "method") node.kind = "init";
|
||||
if (((node: any): N.ClassMethod).kind === "method") node.kind = "init";
|
||||
node.shorthand = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1842,7 +1842,9 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
super.assertModuleNodeAllowed(node);
|
||||
}
|
||||
|
||||
parseExport(node: N.ExportNamedDeclaration): N.ExportNamedDeclaration {
|
||||
parseExport(
|
||||
node: N.ExportNamedDeclaration | N.ExportAllDeclaration,
|
||||
): N.ExportNamedDeclaration | N.ExportAllDeclaration {
|
||||
node = super.parseExport(node);
|
||||
if (
|
||||
node.type === "ExportNamedDeclaration" ||
|
||||
|
||||
@@ -140,7 +140,10 @@ export default class State {
|
||||
// The first yield or await expression inside parenthesized expressions
|
||||
// and arrow function parameters. It is used to disallow yield and await in
|
||||
// arrow function parameters.
|
||||
yieldOrAwaitInPossibleArrowParameters: ?N.YieldExpression;
|
||||
yieldOrAwaitInPossibleArrowParameters:
|
||||
| N.YieldExpression
|
||||
| N.AwaitExpression
|
||||
| null;
|
||||
|
||||
// Token store.
|
||||
tokens: Array<Token | N.Comment>;
|
||||
|
||||
Reference in New Issue
Block a user