Upgrade flow to 0.66 and fix a few minor errors. (#7431)

This commit is contained in:
Logan Smyth 2018-02-25 19:22:23 -08:00 committed by GitHub
parent 8823e4247e
commit 7ff4a73916
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 11 deletions

View File

@ -3,9 +3,9 @@
*/
declare module "micromatch" {
declare function exports(Array<string>, Array<string>, ?{
nocase: boolean,
}): Array<string>;
declare module.exports: {
(Array<string>, Array<string>, ?{ nocase: boolean }): Array<string>,
};
}
declare module "resolve" {

View File

@ -32,7 +32,7 @@
"eslint-config-babel": "^7.0.2",
"eslint-plugin-flowtype": "^2.20.0",
"eslint-plugin-prettier": "^2.5.0",
"flow-bin": "^0.59.0",
"flow-bin": "^0.66.0",
"graceful-fs": "^4.1.11",
"gulp": "^3.9.0",
"gulp-babel": "^8.0.0-beta.0",

View File

@ -359,6 +359,7 @@ Aliases: `Property`
- `computed`: `boolean` (default: `false`)
- `abstract`: `boolean` (default: `null`)
- `accessibility`: `"public" | "private" | "protected"` (default: `null`)
- `definite`: `boolean` (default: `null`)
- `optional`: `boolean` (default: `null`)
- `readonly`: `boolean` (default: `null`)
- `static`: `boolean` (default: `null`)
@ -2851,6 +2852,7 @@ See also `t.isVariableDeclarator(node, opts)` and `t.assertVariableDeclarator(no
- `id`: `LVal` (required)
- `init`: `Expression` (default: `null`)
- `definite`: `boolean` (default: `null`)
---

View File

@ -1678,7 +1678,9 @@ export default class ExpressionParser extends LValParser {
const oldStrict = this.state.strict;
if (isStrict) this.state.strict = isStrict;
if (node.id) {
this.checkReservedWord(node.id, node.start, true, true);
// TODO(logan): This check is broken because it passes a node object as
// a binding name. Passing the actual string introduces other failures.
// this.checkReservedWord(node.id, node.start, true, true);
}
if (checkLVal) {
const nameHash: any = Object.create(null);

View File

@ -1488,7 +1488,10 @@ export default class StatementParser extends ExpressionParser {
node.declaration.type === "FunctionDeclaration" ||
node.declaration.type === "ClassDeclaration"
) {
this.checkDuplicateExports(node, node.declaration.id.name);
const id = node.declaration.id;
if (!id) throw new Error("Assertion failure");
this.checkDuplicateExports(node, id.name);
} else if (node.declaration.type === "VariableDeclaration") {
for (const declaration of node.declaration.declarations) {
this.checkDeclaration(declaration.id);

View File

@ -1068,6 +1068,8 @@ export type TsType =
| TsArrayType
| TsTupleType
| TsUnionOrIntersectionType
| TsConditionalType
| TsInferType
| TsParenthesizedType
| TsTypeOperator
| TsIndexedAccessType
@ -1163,10 +1165,10 @@ export type TsConditionalType = TsTypeBase & {
checkType: TsType,
extendsType: TsType,
trueType: TsType,
falseType: tsType,
falseType: TsType,
};
export type InferType = TsTypeBase & {
export type TsInferType = TsTypeBase & {
type: "TSInferType",
typeParameter: TypeParameter,
};

View File

@ -3074,9 +3074,9 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"
flow-bin@^0.59.0:
version "0.59.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.59.0.tgz#8c151ee7f09f1deed9bf0b9d1f2e8ab9d470f1bb"
flow-bin@^0.66.0:
version "0.66.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.66.0.tgz#a96dde7015dc3343fd552a7b4963c02be705ca26"
for-in@^1.0.1, for-in@^1.0.2:
version "1.0.2"