Skip to content

Commit

Permalink
fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
Kingwl committed Jan 25, 2019
1 parent c8a3ae3 commit 9eb45ea
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/compiler/checker.ts
Expand Up @@ -25666,8 +25666,8 @@ namespace ts {
// For a binding pattern, validate the initializer and exit
if (isBindingPattern(node.name)) {
const needCheckInitializer = node.initializer && node.parent.parent.kind !== SyntaxKind.ForInStatement;
const needCheckWinendType = node.name.elements.length === 0;
if (needCheckInitializer || needCheckWinendType) {
const needCheckWidenedType = node.name.elements.length === 0;
if (needCheckInitializer || needCheckWidenedType) {
// Don't validate for-in initializer as it is already an error
const widenedType = getWidenedTypeForVariableLikeDeclaration(node);
if (needCheckInitializer) {
Expand All @@ -25676,15 +25676,12 @@ namespace ts {
checkNonNullType(initializerType, node);
}
else {
checkTypeAssignableTo(initializerType, widenedType, node, /*headMessage*/ undefined);
checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);
}
checkParameterInitializer(node);
} else {
checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);
}

// check the binding pattern with empty elements
if (needCheckWinendType) {
if (needCheckWidenedType) {
if (isArrayBindingPattern(node.name)) {
checkIteratedTypeOrElementType(widenedType, node, /* allowStringInput */ false, /* allowAsyncIterables */ false);
}
Expand Down

0 comments on commit 9eb45ea

Please sign in to comment.