mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Make node type predicates public (#16121)
* Make node type predicates public * Rename isJSDocComment back to isJSDoc
This commit is contained in:
@@ -21082,10 +21082,6 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function isAccessor(kind: SyntaxKind): boolean {
|
||||
return kind === SyntaxKind.GetAccessor || kind === SyntaxKind.SetAccessor;
|
||||
}
|
||||
|
||||
function checkInheritedPropertiesAreIdentical(type: InterfaceType, typeNode: Node): boolean {
|
||||
const baseTypes = getBaseTypes(type);
|
||||
if (baseTypes.length < 2) {
|
||||
@@ -24555,7 +24551,7 @@ namespace ts {
|
||||
function checkGrammarStatementInAmbientContext(node: Node): boolean {
|
||||
if (isInAmbientContext(node)) {
|
||||
// An accessors is already reported about the ambient context
|
||||
if (isAccessor(node.parent.kind)) {
|
||||
if (isAccessor(node.parent)) {
|
||||
return getNodeLinks(node).hasReportedStatementInAmbientContext = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -3908,7 +3908,7 @@ namespace ts {
|
||||
return bindingElement.right;
|
||||
}
|
||||
|
||||
if (isSpreadExpression(bindingElement)) {
|
||||
if (isSpreadElement(bindingElement)) {
|
||||
// Recovery consistent with existing emit.
|
||||
return getInitializerOfBindingOrAssignmentElement(<BindingOrAssignmentElement>bindingElement.expression);
|
||||
}
|
||||
@@ -3976,7 +3976,7 @@ namespace ts {
|
||||
return getTargetOfBindingOrAssignmentElement(<BindingOrAssignmentElement>bindingElement.left);
|
||||
}
|
||||
|
||||
if (isSpreadExpression(bindingElement)) {
|
||||
if (isSpreadElement(bindingElement)) {
|
||||
// `a` in `[...a] = ...`
|
||||
return getTargetOfBindingOrAssignmentElement(<BindingOrAssignmentElement>bindingElement.expression);
|
||||
}
|
||||
|
||||
@@ -3396,7 +3396,7 @@ namespace ts {
|
||||
else {
|
||||
if (segments.length === 1) {
|
||||
const firstElement = elements[0];
|
||||
return needsUniqueCopy && isSpreadExpression(firstElement) && firstElement.expression.kind !== SyntaxKind.ArrayLiteralExpression
|
||||
return needsUniqueCopy && isSpreadElement(firstElement) && firstElement.expression.kind !== SyntaxKind.ArrayLiteralExpression
|
||||
? createArraySlice(segments[0])
|
||||
: segments[0];
|
||||
}
|
||||
@@ -3407,7 +3407,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function partitionSpread(node: Expression) {
|
||||
return isSpreadExpression(node)
|
||||
return isSpreadElement(node)
|
||||
? visitSpanOfSpreads
|
||||
: visitSpanOfNonSpreads;
|
||||
}
|
||||
|
||||
@@ -1502,7 +1502,7 @@ namespace ts {
|
||||
if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) {
|
||||
return hasExportedReferenceInDestructuringTarget(node.left);
|
||||
}
|
||||
else if (isSpreadExpression(node)) {
|
||||
else if (isSpreadElement(node)) {
|
||||
return hasExportedReferenceInDestructuringTarget(node.expression);
|
||||
}
|
||||
else if (isObjectLiteralExpression(node)) {
|
||||
|
||||
+1321
-816
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user