mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update LKG for 5.2.1 RC.
This commit is contained in:
Vendored
+2
-2
@@ -56,10 +56,10 @@ interface Array<T> {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
}
|
||||
|
||||
interface ArrayConstructor {
|
||||
|
||||
Vendored
+4
-4
@@ -165,10 +165,10 @@ interface BigInt64Array {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/** Yields index, value pairs for every entry in the array. */
|
||||
entries(): IterableIterator<[number, bigint]>;
|
||||
@@ -437,10 +437,10 @@ interface BigUint64Array {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/** Yields index, value pairs for every entry in the array. */
|
||||
entries(): IterableIterator<[number, bigint]>;
|
||||
|
||||
Vendored
+18
-18
@@ -1889,10 +1889,10 @@ interface Int8Array {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
@@ -2171,10 +2171,10 @@ interface Uint8Array {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
@@ -2453,10 +2453,10 @@ interface Uint8ClampedArray {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
@@ -2734,10 +2734,10 @@ interface Int16Array {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
@@ -3016,10 +3016,10 @@ interface Uint16Array {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
@@ -3298,10 +3298,10 @@ interface Int32Array {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
@@ -3580,10 +3580,10 @@ interface Uint32Array {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
@@ -3861,10 +3861,10 @@ interface Float32Array {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
@@ -4144,10 +4144,10 @@ interface Float64Array {
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end. If start is omitted, `0` is used.
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start?: number, end?: number): this;
|
||||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
|
||||
+528
-351
File diff suppressed because it is too large
Load Diff
+965
-524
File diff suppressed because it is too large
Load Diff
Vendored
+23
-2
@@ -2124,11 +2124,17 @@ declare namespace ts {
|
||||
arguments: InlayHintsRequestArgs;
|
||||
}
|
||||
interface InlayHintItem {
|
||||
/** This property will be the empty string when displayParts is set. */
|
||||
text: string;
|
||||
position: Location;
|
||||
kind: InlayHintKind;
|
||||
whitespaceBefore?: boolean;
|
||||
whitespaceAfter?: boolean;
|
||||
displayParts?: InlayHintItemDisplayPart[];
|
||||
}
|
||||
interface InlayHintItemDisplayPart {
|
||||
text: string;
|
||||
span?: FileSpan;
|
||||
}
|
||||
interface InlayHintsResponse extends Response {
|
||||
body?: InlayHintItem[];
|
||||
@@ -2832,6 +2838,7 @@ declare namespace ts {
|
||||
readonly includeInlayPropertyDeclarationTypeHints?: boolean;
|
||||
readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
|
||||
readonly includeInlayEnumMemberValueHints?: boolean;
|
||||
readonly interactiveInlayHints?: boolean;
|
||||
readonly autoImportFileExcludePatterns?: string[];
|
||||
/**
|
||||
* Indicates whether imports should be organized in a case-insensitive manner.
|
||||
@@ -3400,7 +3407,7 @@ declare namespace ts {
|
||||
markAsDirty(): void;
|
||||
getScriptFileNames(): string[];
|
||||
getLanguageService(): never;
|
||||
getModuleResolutionHostForAutoImportProvider(): never;
|
||||
getHostForAutoImportProvider(): never;
|
||||
getProjectReferences(): readonly ts.ProjectReference[] | undefined;
|
||||
getTypeAcquisition(): TypeAcquisition;
|
||||
}
|
||||
@@ -5827,9 +5834,11 @@ declare namespace ts {
|
||||
};
|
||||
}) | ExportDeclaration & {
|
||||
readonly isTypeOnly: true;
|
||||
readonly moduleSpecifier: Expression;
|
||||
} | NamespaceExport & {
|
||||
readonly parent: ExportDeclaration & {
|
||||
readonly isTypeOnly: true;
|
||||
readonly moduleSpecifier: Expression;
|
||||
};
|
||||
};
|
||||
type TypeOnlyAliasDeclaration = TypeOnlyImportDeclaration | TypeOnlyExportDeclaration;
|
||||
@@ -6274,7 +6283,7 @@ declare namespace ts {
|
||||
getSourceFileByPath(path: Path): SourceFile | undefined;
|
||||
getCurrentDirectory(): string;
|
||||
}
|
||||
interface ParseConfigHost {
|
||||
interface ParseConfigHost extends ModuleResolutionHost {
|
||||
useCaseSensitiveFileNames: boolean;
|
||||
readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): readonly string[];
|
||||
/**
|
||||
@@ -8400,6 +8409,7 @@ declare namespace ts {
|
||||
readonly includeInlayPropertyDeclarationTypeHints?: boolean;
|
||||
readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
|
||||
readonly includeInlayEnumMemberValueHints?: boolean;
|
||||
readonly interactiveInlayHints?: boolean;
|
||||
readonly allowRenameOfImportPath?: boolean;
|
||||
readonly autoImportFileExcludePatterns?: string[];
|
||||
readonly organizeImportsIgnoreCase?: "auto" | boolean;
|
||||
@@ -10382,11 +10392,18 @@ declare namespace ts {
|
||||
Enum = "Enum"
|
||||
}
|
||||
interface InlayHint {
|
||||
/** This property will be the empty string when displayParts is set. */
|
||||
text: string;
|
||||
position: number;
|
||||
kind: InlayHintKind;
|
||||
whitespaceBefore?: boolean;
|
||||
whitespaceAfter?: boolean;
|
||||
displayParts?: InlayHintDisplayPart[];
|
||||
}
|
||||
interface InlayHintDisplayPart {
|
||||
text: string;
|
||||
span?: TextSpan;
|
||||
file?: string;
|
||||
}
|
||||
interface TodoCommentDescriptor {
|
||||
text: string;
|
||||
@@ -10978,6 +10995,10 @@ declare namespace ts {
|
||||
variableElement = "var",
|
||||
/** Inside function */
|
||||
localVariableElement = "local var",
|
||||
/** using foo = ... */
|
||||
variableUsingElement = "using",
|
||||
/** await using foo = ... */
|
||||
variableAwaitUsingElement = "await using",
|
||||
/**
|
||||
* Inside module and script only
|
||||
* function f() { }
|
||||
|
||||
+962
-525
File diff suppressed because it is too large
Load Diff
Vendored
+15
-1
@@ -1774,9 +1774,11 @@ declare namespace ts {
|
||||
};
|
||||
}) | ExportDeclaration & {
|
||||
readonly isTypeOnly: true;
|
||||
readonly moduleSpecifier: Expression;
|
||||
} | NamespaceExport & {
|
||||
readonly parent: ExportDeclaration & {
|
||||
readonly isTypeOnly: true;
|
||||
readonly moduleSpecifier: Expression;
|
||||
};
|
||||
};
|
||||
type TypeOnlyAliasDeclaration = TypeOnlyImportDeclaration | TypeOnlyExportDeclaration;
|
||||
@@ -2221,7 +2223,7 @@ declare namespace ts {
|
||||
getSourceFileByPath(path: Path): SourceFile | undefined;
|
||||
getCurrentDirectory(): string;
|
||||
}
|
||||
interface ParseConfigHost {
|
||||
interface ParseConfigHost extends ModuleResolutionHost {
|
||||
useCaseSensitiveFileNames: boolean;
|
||||
readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): readonly string[];
|
||||
/**
|
||||
@@ -4347,6 +4349,7 @@ declare namespace ts {
|
||||
readonly includeInlayPropertyDeclarationTypeHints?: boolean;
|
||||
readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
|
||||
readonly includeInlayEnumMemberValueHints?: boolean;
|
||||
readonly interactiveInlayHints?: boolean;
|
||||
readonly allowRenameOfImportPath?: boolean;
|
||||
readonly autoImportFileExcludePatterns?: string[];
|
||||
readonly organizeImportsIgnoreCase?: "auto" | boolean;
|
||||
@@ -6413,11 +6416,18 @@ declare namespace ts {
|
||||
Enum = "Enum"
|
||||
}
|
||||
interface InlayHint {
|
||||
/** This property will be the empty string when displayParts is set. */
|
||||
text: string;
|
||||
position: number;
|
||||
kind: InlayHintKind;
|
||||
whitespaceBefore?: boolean;
|
||||
whitespaceAfter?: boolean;
|
||||
displayParts?: InlayHintDisplayPart[];
|
||||
}
|
||||
interface InlayHintDisplayPart {
|
||||
text: string;
|
||||
span?: TextSpan;
|
||||
file?: string;
|
||||
}
|
||||
interface TodoCommentDescriptor {
|
||||
text: string;
|
||||
@@ -7009,6 +7019,10 @@ declare namespace ts {
|
||||
variableElement = "var",
|
||||
/** Inside function */
|
||||
localVariableElement = "local var",
|
||||
/** using foo = ... */
|
||||
variableUsingElement = "using",
|
||||
/** await using foo = ... */
|
||||
variableAwaitUsingElement = "await using",
|
||||
/**
|
||||
* Inside module and script only
|
||||
* function f() { }
|
||||
|
||||
+927
-506
File diff suppressed because it is too large
Load Diff
+111
-84
@@ -507,7 +507,7 @@ function identity(x) {
|
||||
function toLowerCase(x) {
|
||||
return x.toLowerCase();
|
||||
}
|
||||
var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g;
|
||||
var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;
|
||||
function toFileNameLowerCase(x) {
|
||||
return fileNameLowerCaseRegExp.test(x) ? x.replace(fileNameLowerCaseRegExp, toLowerCase) : x;
|
||||
}
|
||||
@@ -759,8 +759,8 @@ function unorderedRemoveFirstItemWhere(array, predicate) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function createGetCanonicalFileName(useCaseSensitiveFileNames) {
|
||||
return useCaseSensitiveFileNames ? identity : toFileNameLowerCase;
|
||||
function createGetCanonicalFileName(useCaseSensitiveFileNames2) {
|
||||
return useCaseSensitiveFileNames2 ? identity : toFileNameLowerCase;
|
||||
}
|
||||
function patternText({ prefix, suffix }) {
|
||||
return `${prefix}*${suffix}`;
|
||||
@@ -1067,7 +1067,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
||||
return func.name;
|
||||
} else {
|
||||
const text = Function.prototype.toString.call(func);
|
||||
const match = /^function\s+([\w\$]+)\s*\(/.exec(text);
|
||||
const match = /^function\s+([\w$]+)\s*\(/.exec(text);
|
||||
return match ? match[1] : "";
|
||||
}
|
||||
}
|
||||
@@ -1850,7 +1850,7 @@ ${lanes.join("\n")}
|
||||
})(Debug || (Debug = {}));
|
||||
|
||||
// src/compiler/semver.ts
|
||||
var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
|
||||
var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
|
||||
var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
|
||||
var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
|
||||
var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
|
||||
@@ -3193,7 +3193,8 @@ var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
|
||||
SignatureFlags4[SignatureFlags4["IsOuterCallChain"] = 16] = "IsOuterCallChain";
|
||||
SignatureFlags4[SignatureFlags4["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
|
||||
SignatureFlags4[SignatureFlags4["IsNonInferrable"] = 64] = "IsNonInferrable";
|
||||
SignatureFlags4[SignatureFlags4["PropagatingFlags"] = 39] = "PropagatingFlags";
|
||||
SignatureFlags4[SignatureFlags4["IsSignatureCandidateForOverloadFailure"] = 128] = "IsSignatureCandidateForOverloadFailure";
|
||||
SignatureFlags4[SignatureFlags4["PropagatingFlags"] = 167] = "PropagatingFlags";
|
||||
SignatureFlags4[SignatureFlags4["CallChainFlags"] = 24] = "CallChainFlags";
|
||||
return SignatureFlags4;
|
||||
})(SignatureFlags || {});
|
||||
@@ -3586,10 +3587,10 @@ function createDynamicPriorityPollingWatchFile(host) {
|
||||
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
|
||||
}
|
||||
}
|
||||
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
|
||||
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
|
||||
const fileWatcherCallbacks = createMultiMap();
|
||||
const dirWatchers = /* @__PURE__ */ new Map();
|
||||
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames);
|
||||
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
||||
return nonPollingWatchFile;
|
||||
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
|
||||
const filePath = toCanonicalName(fileName);
|
||||
@@ -3665,8 +3666,8 @@ function createFixedChunkSizePollingWatchFile(host) {
|
||||
pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */, "pollQueue");
|
||||
}
|
||||
}
|
||||
function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) {
|
||||
const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
|
||||
function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, callback, createWatcher) {
|
||||
const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
||||
const path2 = toCanonicalFileName(name);
|
||||
const existing = cache.get(path2);
|
||||
if (existing) {
|
||||
@@ -3715,7 +3716,7 @@ function sysLog(s) {
|
||||
}
|
||||
function createDirectoryWatcherSupportingRecursive({
|
||||
watchDirectory,
|
||||
useCaseSensitiveFileNames,
|
||||
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
||||
getCurrentDirectory,
|
||||
getAccessibleSortedChildDirectories,
|
||||
fileSystemEntryExists,
|
||||
@@ -3727,8 +3728,8 @@ function createDirectoryWatcherSupportingRecursive({
|
||||
const callbackCache = createMultiMap();
|
||||
const cacheToUpdateChildWatches = /* @__PURE__ */ new Map();
|
||||
let timerToUpdateChildWatches;
|
||||
const filePathComparer = getStringComparer(!useCaseSensitiveFileNames);
|
||||
const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames);
|
||||
const filePathComparer = getStringComparer(!useCaseSensitiveFileNames2);
|
||||
const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
||||
return (dirName, callback, recursive, options) => recursive ? createDirectoryWatcher(dirName, options, callback) : watchDirectory(dirName, callback, recursive, options);
|
||||
function createDirectoryWatcher(dirName, options, callback) {
|
||||
const dirPath = toCanonicalFilePath(dirName);
|
||||
@@ -3895,12 +3896,12 @@ function createDirectoryWatcherSupportingRecursive({
|
||||
}
|
||||
}
|
||||
function isIgnoredPath(path2, options) {
|
||||
return some(ignoredPaths, (searchPath) => isInPath(path2, searchPath)) || isIgnoredByWatchOptions(path2, options, useCaseSensitiveFileNames, getCurrentDirectory);
|
||||
return some(ignoredPaths, (searchPath) => isInPath(path2, searchPath)) || isIgnoredByWatchOptions(path2, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
||||
}
|
||||
function isInPath(path2, searchPath) {
|
||||
if (stringContains(path2, searchPath))
|
||||
return true;
|
||||
if (useCaseSensitiveFileNames)
|
||||
if (useCaseSensitiveFileNames2)
|
||||
return false;
|
||||
return stringContains(toCanonicalFilePath(path2), searchPath);
|
||||
}
|
||||
@@ -3918,14 +3919,14 @@ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModi
|
||||
}
|
||||
};
|
||||
}
|
||||
function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames, getCurrentDirectory) {
|
||||
return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames, getCurrentDirectory()));
|
||||
function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
|
||||
return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames2, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2, getCurrentDirectory()));
|
||||
}
|
||||
function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory) {
|
||||
function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
|
||||
return (eventName, relativeFileName) => {
|
||||
if (eventName === "rename") {
|
||||
const fileName = !relativeFileName ? directoryName : normalizePath(combinePaths(directoryName, relativeFileName));
|
||||
if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames, getCurrentDirectory)) {
|
||||
if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames2, getCurrentDirectory)) {
|
||||
callback(fileName);
|
||||
}
|
||||
}
|
||||
@@ -3938,7 +3939,7 @@ function createSystemWatchFunctions({
|
||||
clearTimeout: clearTimeout2,
|
||||
fsWatchWorker,
|
||||
fileSystemEntryExists,
|
||||
useCaseSensitiveFileNames,
|
||||
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
||||
getCurrentDirectory,
|
||||
fsSupportsRecursiveFsWatch,
|
||||
getAccessibleSortedChildDirectories,
|
||||
@@ -4010,7 +4011,7 @@ function createSystemWatchFunctions({
|
||||
);
|
||||
case 5 /* UseFsEventsOnParentDirectory */:
|
||||
if (!nonPollingWatchFile) {
|
||||
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames);
|
||||
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
|
||||
}
|
||||
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
|
||||
default:
|
||||
@@ -4059,7 +4060,7 @@ function createSystemWatchFunctions({
|
||||
return fsWatch(
|
||||
directoryName,
|
||||
1 /* Directory */,
|
||||
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory),
|
||||
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
|
||||
recursive,
|
||||
500 /* Medium */,
|
||||
getFallbackOptions(options)
|
||||
@@ -4067,7 +4068,7 @@ function createSystemWatchFunctions({
|
||||
}
|
||||
if (!hostRecursiveDirectoryWatcher) {
|
||||
hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({
|
||||
useCaseSensitiveFileNames,
|
||||
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
||||
getCurrentDirectory,
|
||||
fileSystemEntryExists,
|
||||
getAccessibleSortedChildDirectories,
|
||||
@@ -4113,7 +4114,7 @@ function createSystemWatchFunctions({
|
||||
return fsWatch(
|
||||
directoryName,
|
||||
1 /* Directory */,
|
||||
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory),
|
||||
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
|
||||
recursive,
|
||||
500 /* Medium */,
|
||||
getFallbackOptions(watchDirectoryOptions)
|
||||
@@ -4141,7 +4142,7 @@ function createSystemWatchFunctions({
|
||||
function pollingWatchFile(fileName, callback, pollingInterval, options) {
|
||||
return createSingleWatcherPerName(
|
||||
pollingWatches,
|
||||
useCaseSensitiveFileNames,
|
||||
useCaseSensitiveFileNames2,
|
||||
fileName,
|
||||
callback,
|
||||
(cb) => pollingWatchFileWorker(fileName, cb, pollingInterval, options)
|
||||
@@ -4150,7 +4151,7 @@ function createSystemWatchFunctions({
|
||||
function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
||||
return createSingleWatcherPerName(
|
||||
recursive ? fsWatchesRecursive : fsWatches,
|
||||
useCaseSensitiveFileNames,
|
||||
useCaseSensitiveFileNames2,
|
||||
fileOrDirectory,
|
||||
callback,
|
||||
(cb) => fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions)
|
||||
@@ -4278,7 +4279,7 @@ var sys = (() => {
|
||||
const Buffer2 = require("buffer").Buffer;
|
||||
const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
||||
const platform = _os.platform();
|
||||
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
||||
const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
|
||||
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
||||
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
||||
const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
|
||||
@@ -4289,7 +4290,7 @@ var sys = (() => {
|
||||
setTimeout,
|
||||
clearTimeout,
|
||||
fsWatchWorker,
|
||||
useCaseSensitiveFileNames,
|
||||
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
||||
getCurrentDirectory,
|
||||
fileSystemEntryExists,
|
||||
// Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
|
||||
@@ -4306,7 +4307,7 @@ var sys = (() => {
|
||||
const nodeSystem = {
|
||||
args: process.argv.slice(2),
|
||||
newLine: _os.EOL,
|
||||
useCaseSensitiveFileNames,
|
||||
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
||||
write(s) {
|
||||
process.stdout.write(s);
|
||||
},
|
||||
@@ -4435,12 +4436,12 @@ var sys = (() => {
|
||||
for (const node of profile.nodes) {
|
||||
if (node.callFrame.url) {
|
||||
const url = normalizeSlashes(node.callFrame.url);
|
||||
if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames)) {
|
||||
if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames2)) {
|
||||
node.callFrame.url = getRelativePathToDirectoryOrUrl(
|
||||
fileUrlRoot,
|
||||
url,
|
||||
fileUrlRoot,
|
||||
createGetCanonicalFileName(useCaseSensitiveFileNames),
|
||||
createGetCanonicalFileName(useCaseSensitiveFileNames2),
|
||||
/*isAbsolutePathAnUrl*/
|
||||
true
|
||||
);
|
||||
@@ -4620,7 +4621,7 @@ var sys = (() => {
|
||||
}
|
||||
}
|
||||
function readDirectory(path2, extensions, excludes, includes, depth) {
|
||||
return matchFiles(path2, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
|
||||
return matchFiles(path2, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
|
||||
}
|
||||
function fileSystemEntryExists(path2, entryKind) {
|
||||
const originalStackTraceLimit = Error.stackTraceLimit;
|
||||
@@ -5137,6 +5138,7 @@ var Diagnostics = {
|
||||
Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: diag(1062, 1 /* Error */, "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."),
|
||||
An_export_assignment_cannot_be_used_in_a_namespace: diag(1063, 1 /* Error */, "An_export_assignment_cannot_be_used_in_a_namespace_1063", "An export assignment cannot be used in a namespace."),
|
||||
The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0: diag(1064, 1 /* Error */, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064", "The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<{0}>'?"),
|
||||
The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: diag(1065, 1 /* Error */, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1065", "The return type of an async function or method must be the global Promise<T> type."),
|
||||
In_ambient_enum_declarations_member_initializer_must_be_constant_expression: diag(1066, 1 /* Error */, "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", "In ambient enum declarations member initializer must be constant expression."),
|
||||
Unexpected_token_A_constructor_method_accessor_or_property_was_expected: diag(1068, 1 /* Error */, "Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068", "Unexpected token. A constructor, method, accessor, or property was expected."),
|
||||
Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces: diag(1069, 1 /* Error */, "Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069", "Unexpected token. A type parameter name was expected without curly braces."),
|
||||
@@ -6839,6 +6841,7 @@ var Diagnostics = {
|
||||
Parameter_modifiers_can_only_be_used_in_TypeScript_files: diag(8012, 1 /* Error */, "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012", "Parameter modifiers can only be used in TypeScript files."),
|
||||
Non_null_assertions_can_only_be_used_in_TypeScript_files: diag(8013, 1 /* Error */, "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013", "Non-null assertions can only be used in TypeScript files."),
|
||||
Type_assertion_expressions_can_only_be_used_in_TypeScript_files: diag(8016, 1 /* Error */, "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016", "Type assertion expressions can only be used in TypeScript files."),
|
||||
Signature_declarations_can_only_be_used_in_TypeScript_files: diag(8017, 1 /* Error */, "Signature_declarations_can_only_be_used_in_TypeScript_files_8017", "Signature declarations can only be used in TypeScript files."),
|
||||
Report_errors_in_js_files: diag(8019, 3 /* Message */, "Report_errors_in_js_files_8019", "Report errors in .js files."),
|
||||
JSDoc_types_can_only_be_used_inside_documentation_comments: diag(8020, 1 /* Error */, "JSDoc_types_can_only_be_used_inside_documentation_comments_8020", "JSDoc types can only be used inside documentation comments."),
|
||||
JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: diag(8021, 1 /* Error */, "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021", "JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),
|
||||
@@ -7889,7 +7892,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
||||
if (withMinus)
|
||||
start2--;
|
||||
error(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start2, pos - start2, literal);
|
||||
return { type: 9 /* NumericLiteral */, value: tokenValue };
|
||||
return 9 /* NumericLiteral */;
|
||||
}
|
||||
} else {
|
||||
mainFragment = scanNumberFragment();
|
||||
@@ -7929,20 +7932,18 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
||||
}
|
||||
if (tokenFlags & 8192 /* ContainsLeadingZero */) {
|
||||
error(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start2, end2 - start2);
|
||||
return { type: 9 /* NumericLiteral */, value: "" + +result };
|
||||
tokenValue = "" + +result;
|
||||
return 9 /* NumericLiteral */;
|
||||
}
|
||||
if (decimalFragment !== void 0 || tokenFlags & 16 /* Scientific */) {
|
||||
checkForIdentifierStartAfterNumericLiteral(start2, decimalFragment === void 0 && !!(tokenFlags & 16 /* Scientific */));
|
||||
return {
|
||||
type: 9 /* NumericLiteral */,
|
||||
value: "" + +result
|
||||
// if value is not an integer, it can be safely coerced to a number
|
||||
};
|
||||
tokenValue = "" + +result;
|
||||
return 9 /* NumericLiteral */;
|
||||
} else {
|
||||
tokenValue = result;
|
||||
const type = checkBigIntSuffix();
|
||||
checkForIdentifierStartAfterNumericLiteral(start2);
|
||||
return { type, value: tokenValue };
|
||||
return type;
|
||||
}
|
||||
}
|
||||
function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) {
|
||||
@@ -8551,7 +8552,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
||||
return token = 41 /* MinusToken */;
|
||||
case 46 /* dot */:
|
||||
if (isDigit(text.charCodeAt(pos + 1))) {
|
||||
tokenValue = scanNumber().value;
|
||||
scanNumber();
|
||||
return token = 9 /* NumericLiteral */;
|
||||
}
|
||||
if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) {
|
||||
@@ -8669,8 +8670,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
||||
case 55 /* _7 */:
|
||||
case 56 /* _8 */:
|
||||
case 57 /* _9 */:
|
||||
({ type: token, value: tokenValue } = scanNumber());
|
||||
return token;
|
||||
return token = scanNumber();
|
||||
case 58 /* colon */:
|
||||
pos++;
|
||||
return token = 59 /* ColonToken */;
|
||||
@@ -11302,7 +11302,10 @@ function getResolveJsonModule(compilerOptions) {
|
||||
}
|
||||
return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
|
||||
}
|
||||
var reservedCharacterPattern = /[^\w\s\/]/g;
|
||||
function getAllowJSCompilerOption(compilerOptions) {
|
||||
return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
|
||||
}
|
||||
var reservedCharacterPattern = /[^\w\s/]/g;
|
||||
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
|
||||
var commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
|
||||
var implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`;
|
||||
@@ -11411,7 +11414,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm
|
||||
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
|
||||
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
|
||||
}
|
||||
function getFileMatcherPatterns(path2, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
|
||||
function getFileMatcherPatterns(path2, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) {
|
||||
path2 = normalizePath(path2);
|
||||
currentDirectory = normalizePath(currentDirectory);
|
||||
const absolutePath = combinePaths(currentDirectory, path2);
|
||||
@@ -11420,22 +11423,22 @@ function getFileMatcherPatterns(path2, excludes, includes, useCaseSensitiveFileN
|
||||
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
||||
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
||||
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
||||
basePaths: getBasePaths(path2, includes, useCaseSensitiveFileNames)
|
||||
basePaths: getBasePaths(path2, includes, useCaseSensitiveFileNames2)
|
||||
};
|
||||
}
|
||||
function getRegexFromPattern(pattern, useCaseSensitiveFileNames) {
|
||||
return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i");
|
||||
function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) {
|
||||
return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i");
|
||||
}
|
||||
function matchFiles(path2, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
|
||||
function matchFiles(path2, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) {
|
||||
path2 = normalizePath(path2);
|
||||
currentDirectory = normalizePath(currentDirectory);
|
||||
const patterns = getFileMatcherPatterns(path2, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
|
||||
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames));
|
||||
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);
|
||||
const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames);
|
||||
const patterns = getFileMatcherPatterns(path2, excludes, includes, useCaseSensitiveFileNames2, currentDirectory);
|
||||
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames2));
|
||||
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames2);
|
||||
const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames2);
|
||||
const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]];
|
||||
const visited = /* @__PURE__ */ new Map();
|
||||
const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames);
|
||||
const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
||||
for (const basePath of patterns.basePaths) {
|
||||
visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
|
||||
}
|
||||
@@ -11477,7 +11480,7 @@ function matchFiles(path2, extensions, excludes, includes, useCaseSensitiveFileN
|
||||
}
|
||||
}
|
||||
}
|
||||
function getBasePaths(path2, includes, useCaseSensitiveFileNames) {
|
||||
function getBasePaths(path2, includes, useCaseSensitiveFileNames2) {
|
||||
const basePaths = [path2];
|
||||
if (includes) {
|
||||
const includeBasePaths = [];
|
||||
@@ -11485,9 +11488,9 @@ function getBasePaths(path2, includes, useCaseSensitiveFileNames) {
|
||||
const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path2, include));
|
||||
includeBasePaths.push(getIncludeBasePath(absolute));
|
||||
}
|
||||
includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames));
|
||||
includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2));
|
||||
for (const includeBasePath of includeBasePaths) {
|
||||
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path2, !useCaseSensitiveFileNames))) {
|
||||
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path2, !useCaseSensitiveFileNames2))) {
|
||||
basePaths.push(includeBasePath);
|
||||
}
|
||||
}
|
||||
@@ -18498,7 +18501,8 @@ var Parser;
|
||||
nextToken();
|
||||
const statements = parseList(0 /* SourceElements */, parseStatement);
|
||||
Debug.assert(token() === 1 /* EndOfFileToken */);
|
||||
const endOfFileToken = addJSDocComment(parseTokenNode());
|
||||
const endHasJSDoc = hasPrecedingJSDocComment();
|
||||
const endOfFileToken = withJSDoc(parseTokenNode(), endHasJSDoc);
|
||||
const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2);
|
||||
processCommentPragmas(sourceFile, sourceText);
|
||||
processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);
|
||||
@@ -18518,11 +18522,11 @@ var Parser;
|
||||
parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic));
|
||||
}
|
||||
}
|
||||
function withJSDoc(node, hasJSDoc) {
|
||||
return hasJSDoc ? addJSDocComment(node) : node;
|
||||
}
|
||||
let hasDeprecatedTag = false;
|
||||
function addJSDocComment(node) {
|
||||
function withJSDoc(node, hasJSDoc) {
|
||||
if (!hasJSDoc) {
|
||||
return node;
|
||||
}
|
||||
Debug.assert(!node.jsDoc);
|
||||
const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), (comment) => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos));
|
||||
if (jsDoc.length)
|
||||
@@ -19316,6 +19320,9 @@ var Parser;
|
||||
case 22 /* HeritageClauses */:
|
||||
return isHeritageClause2();
|
||||
case 23 /* ImportOrExportSpecifiers */:
|
||||
if (token() === 161 /* FromKeyword */ && lookAhead(nextTokenIsStringLiteral)) {
|
||||
return false;
|
||||
}
|
||||
return tokenIsIdentifierOrKeyword(token());
|
||||
case 13 /* JsxAttributes */:
|
||||
return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
|
||||
@@ -19674,6 +19681,9 @@ var Parser;
|
||||
case 22 /* HeritageClauses */:
|
||||
return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected);
|
||||
case 23 /* ImportOrExportSpecifiers */:
|
||||
if (token() === 161 /* FromKeyword */) {
|
||||
return parseErrorAtCurrentToken(Diagnostics._0_expected, "}");
|
||||
}
|
||||
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
||||
case 13 /* JsxAttributes */:
|
||||
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
||||
@@ -21031,12 +21041,14 @@ var Parser;
|
||||
return arrowExpression;
|
||||
}
|
||||
const pos = getNodePos();
|
||||
const hasJSDoc = hasPrecedingJSDocComment();
|
||||
const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
||||
if (expr.kind === 80 /* Identifier */ && token() === 39 /* EqualsGreaterThanToken */) {
|
||||
return parseSimpleArrowFunctionExpression(
|
||||
pos,
|
||||
expr,
|
||||
allowReturnTypeInArrowFunction,
|
||||
hasJSDoc,
|
||||
/*asyncModifier*/
|
||||
void 0
|
||||
);
|
||||
@@ -21082,7 +21094,7 @@ var Parser;
|
||||
), pos);
|
||||
}
|
||||
}
|
||||
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) {
|
||||
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier) {
|
||||
Debug.assert(token() === 39 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
||||
const parameter = factory2.createParameterDeclaration(
|
||||
/*modifiers*/
|
||||
@@ -21115,7 +21127,7 @@ var Parser;
|
||||
equalsGreaterThanToken,
|
||||
body
|
||||
);
|
||||
return addJSDocComment(finishNode(node, pos));
|
||||
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
||||
}
|
||||
function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
||||
const triState = isParenthesizedArrowFunctionExpression();
|
||||
@@ -21243,9 +21255,10 @@ var Parser;
|
||||
if (token() === 134 /* AsyncKeyword */) {
|
||||
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
|
||||
const pos = getNodePos();
|
||||
const hasJSDoc = hasPrecedingJSDocComment();
|
||||
const asyncModifier = parseModifiersForArrowFunction();
|
||||
const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
||||
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier);
|
||||
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier);
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
@@ -22606,10 +22619,14 @@ var Parser;
|
||||
case 124 /* ProtectedKeyword */:
|
||||
case 125 /* PublicKeyword */:
|
||||
case 148 /* ReadonlyKeyword */:
|
||||
const previousToken = token();
|
||||
nextToken();
|
||||
if (scanner.hasPrecedingLineBreak()) {
|
||||
return false;
|
||||
}
|
||||
if (previousToken === 138 /* DeclareKeyword */ && token() === 156 /* TypeKeyword */) {
|
||||
return true;
|
||||
}
|
||||
continue;
|
||||
case 162 /* GlobalKeyword */:
|
||||
nextToken();
|
||||
@@ -22919,6 +22936,9 @@ var Parser;
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
function nextTokenIsStringLiteral() {
|
||||
return nextToken() === 11 /* StringLiteral */;
|
||||
}
|
||||
function nextTokenIsIdentifierOrStringLiteralOnSameLine() {
|
||||
nextToken();
|
||||
return !scanner.hasPrecedingLineBreak() && (isIdentifier2() || token() === 11 /* StringLiteral */);
|
||||
@@ -22971,14 +22991,14 @@ var Parser;
|
||||
function parseObjectBindingPattern() {
|
||||
const pos = getNodePos();
|
||||
parseExpected(19 /* OpenBraceToken */);
|
||||
const elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement);
|
||||
const elements = allowInAnd(() => parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement));
|
||||
parseExpected(20 /* CloseBraceToken */);
|
||||
return finishNode(factory2.createObjectBindingPattern(elements), pos);
|
||||
}
|
||||
function parseArrayBindingPattern() {
|
||||
const pos = getNodePos();
|
||||
parseExpected(23 /* OpenBracketToken */);
|
||||
const elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement);
|
||||
const elements = allowInAnd(() => parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement));
|
||||
parseExpected(24 /* CloseBracketToken */);
|
||||
return finishNode(factory2.createArrayBindingPattern(elements), pos);
|
||||
}
|
||||
@@ -23496,6 +23516,9 @@ var Parser;
|
||||
}
|
||||
function parseTypeAliasDeclaration(pos, hasJSDoc, modifiers) {
|
||||
parseExpected(156 /* TypeKeyword */);
|
||||
if (scanner.hasPrecedingLineBreak()) {
|
||||
parseErrorAtCurrentToken(Diagnostics.Line_break_not_permitted_here);
|
||||
}
|
||||
const name = parseIdentifier();
|
||||
const typeParameters = parseTypeParameters();
|
||||
parseExpected(64 /* EqualsToken */);
|
||||
@@ -24478,7 +24501,7 @@ var Parser;
|
||||
typeExpression = tryParseTypeExpression();
|
||||
}
|
||||
const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
|
||||
const nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent2);
|
||||
const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target, indent2);
|
||||
if (nestedTypeLiteral) {
|
||||
typeExpression = nestedTypeLiteral;
|
||||
isNameFirst = true;
|
||||
@@ -24764,7 +24787,7 @@ var Parser;
|
||||
case 60 /* AtToken */:
|
||||
if (canParseTag) {
|
||||
const child = tryParseChildTag(target, indent2);
|
||||
if (child && (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
|
||||
if (child && (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
|
||||
return false;
|
||||
}
|
||||
return child;
|
||||
@@ -25397,7 +25420,7 @@ function getNamedArgRegEx(name) {
|
||||
return result;
|
||||
}
|
||||
var tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im;
|
||||
var singleLinePragmaRegEx = /^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im;
|
||||
var singleLinePragmaRegEx = /^\/\/\/?\s*@([^\s:]+)(.*)\s*$/im;
|
||||
function extractPragmas(pragmas, range, text) {
|
||||
const tripleSlash = range.kind === 2 /* SingleLineCommentTrivia */ && tripleSlashXMLCommentStartRegEx.exec(text);
|
||||
if (tripleSlash) {
|
||||
@@ -25992,6 +26015,7 @@ var commandOptionsWithoutBuild = [
|
||||
{
|
||||
name: "checkJs",
|
||||
type: "boolean",
|
||||
affectsModuleResolution: true,
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.JavaScript_Support,
|
||||
description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
|
||||
@@ -26218,7 +26242,7 @@ var commandOptionsWithoutBuild = [
|
||||
strictFlag: true,
|
||||
category: Diagnostics.Type_Checking,
|
||||
description: Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
|
||||
defaultValueDescription: false
|
||||
defaultValueDescription: Diagnostics.false_unless_strict_is_set
|
||||
},
|
||||
{
|
||||
name: "alwaysStrict",
|
||||
@@ -27211,17 +27235,17 @@ function invalidDotDotAfterRecursiveWildcard(s) {
|
||||
const lastDotIndex = endsWith(s, "/..") ? s.length : s.lastIndexOf("/../");
|
||||
return lastDotIndex > wildcardIndex;
|
||||
}
|
||||
function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory) {
|
||||
function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory) {
|
||||
return matchesExcludeWorker(
|
||||
pathToCheck,
|
||||
filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)),
|
||||
useCaseSensitiveFileNames,
|
||||
useCaseSensitiveFileNames2,
|
||||
currentDirectory
|
||||
);
|
||||
}
|
||||
function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath) {
|
||||
function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) {
|
||||
const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude");
|
||||
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames);
|
||||
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2);
|
||||
if (!excludeRegex)
|
||||
return false;
|
||||
if (excludeRegex.test(pathToCheck))
|
||||
@@ -27428,8 +27452,8 @@ function getPackageJsonTypesVersionsPaths(typesVersions) {
|
||||
}
|
||||
var nodeModulesAtTypes = combinePaths("node_modules", "@types");
|
||||
function arePathsEqual(path1, path2, host) {
|
||||
const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
||||
return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */;
|
||||
const useCaseSensitiveFileNames2 = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
||||
return comparePaths(path1, path2, !useCaseSensitiveFileNames2) === 0 /* EqualTo */;
|
||||
}
|
||||
function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
|
||||
const resolvedFileName = realPath(fileName, host, traceEnabled);
|
||||
@@ -28237,6 +28261,9 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
|
||||
}
|
||||
const trailingParts = parts.slice(nameParts.length);
|
||||
const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
|
||||
if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) {
|
||||
return loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference);
|
||||
}
|
||||
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
||||
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
||||
return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
|
||||
@@ -28584,13 +28611,10 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
||||
function combineDirectoryPath(root, dir) {
|
||||
return ensureTrailingDirectorySeparator(combinePaths(root, dir));
|
||||
}
|
||||
function useCaseSensitiveFileNames() {
|
||||
return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
|
||||
}
|
||||
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
||||
var _a, _b, _c, _d;
|
||||
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
||||
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames });
|
||||
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
|
||||
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
||||
const commonSourceDirGuesses = [];
|
||||
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
||||
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
|
||||
@@ -28619,7 +28643,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
||||
for (const commonSourceDirGuess of commonSourceDirGuesses) {
|
||||
const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
||||
for (const candidateDir of candidateDirectories) {
|
||||
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
||||
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) {
|
||||
const pathFragment = finalPath.slice(candidateDir.length + 1);
|
||||
const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment);
|
||||
const jsAndDtsExtensions = [".mjs" /* Mjs */, ".cjs" /* Cjs */, ".js" /* Js */, ".json" /* Json */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".d.ts" /* Dts */];
|
||||
@@ -28629,7 +28653,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
||||
for (const possibleExt of inputExts) {
|
||||
if (!extensionIsOk(extensions, possibleExt))
|
||||
continue;
|
||||
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
|
||||
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames(state));
|
||||
if (state.host.fileExists(possibleInputWithInputExtension)) {
|
||||
return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(
|
||||
extensions,
|
||||
@@ -28986,6 +29010,9 @@ function traceIfEnabled(state, diagnostic, ...args) {
|
||||
trace(state.host, diagnostic, ...args);
|
||||
}
|
||||
}
|
||||
function useCaseSensitiveFileNames(state) {
|
||||
return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
|
||||
}
|
||||
|
||||
// src/compiler/checker.ts
|
||||
var nextNodeId = 1;
|
||||
|
||||
Reference in New Issue
Block a user