mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
@@ -14854,7 +14854,7 @@ namespace ts {
|
||||
const declarationContainer = getControlFlowContainer(declaration);
|
||||
let flowContainer = getControlFlowContainer(node);
|
||||
const isOuterVariable = flowContainer !== declarationContainer;
|
||||
const isSpreadDestructuringAsignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
|
||||
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
|
||||
// When the control flow originates in a function expression or arrow function and we are referencing
|
||||
// a const variable or parameter from an outer function, we extend the origin of the control flow
|
||||
// analysis to include the immediately enclosing function.
|
||||
@@ -14866,7 +14866,7 @@ namespace ts {
|
||||
// We only look for uninitialized variables in strict null checking mode, and only when we can analyze
|
||||
// the entire control flow graph from the variable's declaration (i.e. when the flow container and
|
||||
// declaration container are the same).
|
||||
const assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget ||
|
||||
const assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget ||
|
||||
type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & TypeFlags.AnyOrUnknown) !== 0 ||
|
||||
isInTypeQuery(node) || node.parent.kind === SyntaxKind.ExportSpecifier) ||
|
||||
node.parent.kind === SyntaxKind.NonNullExpression ||
|
||||
@@ -19598,7 +19598,7 @@ namespace ts {
|
||||
}
|
||||
const specifier = node.arguments[0];
|
||||
const specifierType = checkExpressionCached(specifier);
|
||||
// Even though multiple arugments is grammatically incorrect, type-check extra arguments for completion
|
||||
// Even though multiple arguments is grammatically incorrect, type-check extra arguments for completion
|
||||
for (let i = 1; i < node.arguments.length; ++i) {
|
||||
checkExpressionCached(node.arguments[i]);
|
||||
}
|
||||
|
||||
@@ -1855,7 +1855,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function getRightMostAssignedExpression(node: Expression): Expression {
|
||||
while (isAssignmentExpression(node, /*excludeCompoundAssignements*/ true)) {
|
||||
while (isAssignmentExpression(node, /*excludeCompoundAssignments*/ true)) {
|
||||
node = node.right;
|
||||
}
|
||||
return node;
|
||||
|
||||
Reference in New Issue
Block a user