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
7 changed files with 20 additions and 11 deletions

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,
};