Skip to content

Commit 340b429

Browse files
committed
fix(compiler): correct minor comment misspellings in checker; related cleanups
1 parent 9059e5b commit 340b429

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/compiler/checker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14739,7 +14739,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1473914739
) {
1474014740
// A reverse mapping of `{[K in keyof T[K_1]]: T[K_1]}` is the same as that of `{[K in keyof T]: T}`, since all we care about is
1474114741
// inferring to the "type parameter" (or indexed access) shared by the constraint and template. So, to reduce the number of
14742-
// type identities produced, we simplify such indexed access occurences
14742+
// type identities produced, we simplify such indexed access occurrences
1474314743
const newTypeParam = (type.constraintType.type as IndexedAccessType).objectType;
1474414744
const newMappedType = replaceIndexedAccess(type.mappedType, type.constraintType.type as ReplaceableIndexedAccessType, newTypeParam);
1474514745
inferredProp.links.mappedType = newMappedType as MappedType;
@@ -16291,7 +16291,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1629116291
}
1629216292
else {
1629316293
// Parameter has no annotation
16294-
// By using a `DeferredType` symbol, we allow the type of this rest arg to be overriden by contextual type assignment so long as its type hasn't been
16294+
// By using a `DeferredType` symbol, we allow the type of this rest arg to be overridden by contextual type assignment so long as its type hasn't been
1629516295
// cached by `getTypeOfSymbol` yet.
1629616296
syntheticArgsSymbol.links.checkFlags |= CheckFlags.DeferredType;
1629716297
syntheticArgsSymbol.links.deferralParent = neverType;
@@ -31010,7 +31010,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3101031010
}
3101131011

3101231012
/**
31013-
* This part of `checkIdentifier` is kept seperate from the rest, so `NodeCheckFlags` (and related diagnostics) can be lazily calculated
31013+
* This part of `checkIdentifier` is kept separate from the rest, so `NodeCheckFlags` (and related diagnostics) can be lazily calculated
3101431014
* without calculating the flow type of the identifier.
3101531015
*/
3101631016
function checkIdentifierCalculateNodeCheckFlags(node: Identifier, symbol: Symbol) {
@@ -50787,7 +50787,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
5078750787
const container = getSourceFileOfNode(symbol.valueDeclaration);
5078850788
const fileSymbol = container && getSymbolOfDeclaration(container);
5078950789
// Ensures cjs export assignment is setup, since this symbol may point at, and merge with, the file itself.
50790-
// If we don't, the merge may not have yet occured, and the flags check below will be missing flags that
50790+
// If we don't, the merge may not have yet occurred, and the flags check below will be missing flags that
5079150791
// are added as a result of the merge.
5079250792
void resolveExternalModuleSymbol(fileSymbol);
5079350793
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));

src/compiler/commandLineParser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4180,12 +4180,12 @@ function getWildcardDirectoryFromSpec(spec: string, useCaseSensitiveFileNames: b
41804180
// characters could match any of the central patterns, resulting in bad backtracking.
41814181
const questionWildcardIndex = spec.indexOf("?");
41824182
const starWildcardIndex = spec.indexOf("*");
4183-
const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
4183+
const lastDirectorySeparatorIndex = spec.lastIndexOf(directorySeparator);
41844184
return {
41854185
key: toCanonicalKey(match[0], useCaseSensitiveFileNames),
41864186
path: match[0],
4187-
flags: (questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex)
4188-
|| (starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex)
4187+
flags: (questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeparatorIndex)
4188+
|| (starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeparatorIndex)
41894189
? WatchDirectoryFlags.Recursive : WatchDirectoryFlags.None,
41904190
};
41914191
}

src/compiler/moduleNameResolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2947,7 +2947,7 @@ function getLoadModuleFromTargetExportOrImport(extensions: Extensions, state: Mo
29472947
for (const candidateDir of candidateDirectories) {
29482948
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) {
29492949
// The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
2950-
const pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
2950+
const pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory separator
29512951
const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment);
29522952
const jsAndDtsExtensions = [Extension.Mjs, Extension.Cjs, Extension.Js, Extension.Json, Extension.Dmts, Extension.Dcts, Extension.Dts];
29532953
for (const ext of jsAndDtsExtensions) {

src/compiler/utilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9965,7 +9965,7 @@ export function getScriptKindFromFileName(fileName: string): ScriptKind {
99659965
}
99669966

99679967
/**
9968-
* Groups of supported extensions in order of file resolution precedence. (eg, TS > TSX > DTS and seperately, CTS > DCTS)
9968+
* Groups of supported extensions in order of file resolution precedence. (eg, TS > TSX > DTS and separately, CTS > DCTS)
99699969
*/
99709970
const supportedTSExtensions: readonly Extension[][] = [[Extension.Ts, Extension.Tsx, Extension.Dts], [Extension.Cts, Extension.Dcts], [Extension.Mts, Extension.Dmts]];
99719971
/** @internal */
@@ -10570,7 +10570,7 @@ export function isValidBigIntString(s: string, roundTripOnly: boolean): boolean
1057010570
// * scanning proceeded without error
1057110571
// * a bigint can be scanned, and that when it is scanned, it is
1057210572
// * the full length of the input string (so the scanner is one character beyond the augmented input length)
10573-
// * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input)
10573+
// * it does not contain a numeric separator (the `BigInt` constructor does not accept a numeric separator in its input)
1057410574
return success && result === SyntaxKind.BigIntLiteral && scanner.getTokenEnd() === (s.length + 1) && !(flags & TokenFlags.ContainsSeparator)
1057510575
&& (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner.getTokenValue()) }));
1057610576
}

src/services/codefixes/addMissingConst.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: Source
6868

6969
const commaExpression = findAncestor(token, node =>
7070
isExpressionStatement(node.parent) ? true :
71-
isPossiblyPartOfCommaSeperatedInitializer(node) ? false : "quit");
71+
isPossiblyPartOfCommaSeparatedInitializer(node) ? false : "quit");
7272
if (commaExpression) {
7373
const checker = program.getTypeChecker();
7474
if (!expressionCouldBeVariableDeclaration(commaExpression, checker)) {
@@ -105,7 +105,7 @@ function arrayElementCouldBeVariableDeclaration(expression: Expression, checker:
105105
return !!identifier && !checker.getSymbolAtLocation(identifier);
106106
}
107107

108-
function isPossiblyPartOfCommaSeperatedInitializer(node: Node): boolean {
108+
function isPossiblyPartOfCommaSeparatedInitializer(node: Node): boolean {
109109
switch (node.kind) {
110110
case SyntaxKind.Identifier:
111111
case SyntaxKind.BinaryExpression:

0 commit comments

Comments
 (0)