@typescript-deploys/pr-build 5.5.0-pr-58380-2 → 5.5.0-pr-58396-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +361 -304
- package/lib/typescript.js +380 -308
- package/package.json +1 -1
package/lib/typescript.js
CHANGED
|
@@ -302,6 +302,7 @@ __export(typescript_exports, {
|
|
|
302
302
|
collectExternalModuleInfo: () => collectExternalModuleInfo,
|
|
303
303
|
combine: () => combine,
|
|
304
304
|
combinePaths: () => combinePaths,
|
|
305
|
+
commandLineOptionOfCustomType: () => commandLineOptionOfCustomType,
|
|
305
306
|
commentPragmas: () => commentPragmas,
|
|
306
307
|
commonOptionsWithBuild: () => commonOptionsWithBuild,
|
|
307
308
|
commonPackageFolders: () => commonPackageFolders,
|
|
@@ -918,6 +919,8 @@ __export(typescript_exports, {
|
|
|
918
919
|
getNameOfDeclaration: () => getNameOfDeclaration,
|
|
919
920
|
getNameOfExpando: () => getNameOfExpando,
|
|
920
921
|
getNameOfJSDocTypedef: () => getNameOfJSDocTypedef,
|
|
922
|
+
getNameOfModuleKind: () => getNameOfModuleKind,
|
|
923
|
+
getNameOfModuleResolutionKind: () => getNameOfModuleResolutionKind,
|
|
921
924
|
getNameOfScriptTarget: () => getNameOfScriptTarget,
|
|
922
925
|
getNameOrArgument: () => getNameOrArgument,
|
|
923
926
|
getNameTable: () => getNameTable,
|
|
@@ -1926,6 +1929,7 @@ __export(typescript_exports, {
|
|
|
1926
1929
|
moduleOptionDeclaration: () => moduleOptionDeclaration,
|
|
1927
1930
|
moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo,
|
|
1928
1931
|
moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter,
|
|
1932
|
+
moduleResolutionOptionDeclaration: () => moduleResolutionOptionDeclaration,
|
|
1929
1933
|
moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations,
|
|
1930
1934
|
moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports,
|
|
1931
1935
|
moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
|
|
@@ -2362,7 +2366,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2362
2366
|
|
|
2363
2367
|
// src/compiler/corePublic.ts
|
|
2364
2368
|
var versionMajorMinor = "5.5";
|
|
2365
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2369
|
+
var version = `${versionMajorMinor}.0-insiders.20240501`;
|
|
2366
2370
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2367
2371
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2368
2372
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6600,7 +6604,8 @@ var CheckFlags = /* @__PURE__ */ ((CheckFlags2) => {
|
|
|
6600
6604
|
CheckFlags2[CheckFlags2["Mapped"] = 262144] = "Mapped";
|
|
6601
6605
|
CheckFlags2[CheckFlags2["StripOptional"] = 524288] = "StripOptional";
|
|
6602
6606
|
CheckFlags2[CheckFlags2["Unresolved"] = 1048576] = "Unresolved";
|
|
6603
|
-
CheckFlags2[CheckFlags2["
|
|
6607
|
+
CheckFlags2[CheckFlags2["SyntheticInterface"] = 2097152] = "SyntheticInterface";
|
|
6608
|
+
CheckFlags2[CheckFlags2["SyntheticMember"] = 6] = "SyntheticMember";
|
|
6604
6609
|
CheckFlags2[CheckFlags2["Discriminant"] = 192] = "Discriminant";
|
|
6605
6610
|
CheckFlags2[CheckFlags2["Partial"] = 48] = "Partial";
|
|
6606
6611
|
return CheckFlags2;
|
|
@@ -17460,7 +17465,7 @@ function entityNameToString(name) {
|
|
|
17460
17465
|
return Debug.assertNever(name.name);
|
|
17461
17466
|
}
|
|
17462
17467
|
case 311 /* JSDocMemberName */:
|
|
17463
|
-
return entityNameToString(name.left) + entityNameToString(name.right);
|
|
17468
|
+
return entityNameToString(name.left) + "#" + entityNameToString(name.right);
|
|
17464
17469
|
case 295 /* JsxNamespacedName */:
|
|
17465
17470
|
return entityNameToString(name.namespace) + ":" + entityNameToString(name.name);
|
|
17466
17471
|
default:
|
|
@@ -21204,7 +21209,7 @@ function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
|
21204
21209
|
const flags = getCombinedModifierFlags(declaration);
|
|
21205
21210
|
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~7 /* AccessibilityModifier */;
|
|
21206
21211
|
}
|
|
21207
|
-
if (getCheckFlags(s) & 6 /*
|
|
21212
|
+
if (getCheckFlags(s) & 6 /* SyntheticMember */) {
|
|
21208
21213
|
const checkFlags = s.links.checkFlags;
|
|
21209
21214
|
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 2 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 1 /* Public */ : 4 /* Protected */;
|
|
21210
21215
|
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 256 /* Static */ : 0;
|
|
@@ -22079,7 +22084,19 @@ function getStrictOptionValue(compilerOptions, flag) {
|
|
|
22079
22084
|
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
22080
22085
|
}
|
|
22081
22086
|
function getNameOfScriptTarget(scriptTarget) {
|
|
22082
|
-
|
|
22087
|
+
const entries = [...targetOptionDeclaration.type].reverse();
|
|
22088
|
+
return forEach(entries, ([key, value]) => value === scriptTarget ? key : void 0);
|
|
22089
|
+
}
|
|
22090
|
+
function getNameOfModuleKind(moduleKind) {
|
|
22091
|
+
const entries = [...moduleOptionDeclaration.type].reverse();
|
|
22092
|
+
return forEach(entries, ([key, value]) => value === moduleKind ? key : void 0);
|
|
22093
|
+
}
|
|
22094
|
+
function getNameOfModuleResolutionKind(moduleResolution) {
|
|
22095
|
+
if (moduleResolution === 2 /* Node10 */) {
|
|
22096
|
+
return "node10";
|
|
22097
|
+
}
|
|
22098
|
+
const entries = [...moduleResolutionOptionDeclaration.type].reverse();
|
|
22099
|
+
return forEach(entries, ([key, value]) => value === moduleResolution ? key : void 0);
|
|
22083
22100
|
}
|
|
22084
22101
|
function getEmitStandardClassFields(compilerOptions) {
|
|
22085
22102
|
return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
|
|
@@ -40416,6 +40433,25 @@ var moduleOptionDeclaration = {
|
|
|
40416
40433
|
description: Diagnostics.Specify_what_module_code_is_generated,
|
|
40417
40434
|
defaultValueDescription: void 0
|
|
40418
40435
|
};
|
|
40436
|
+
var moduleResolutionOptionDeclaration = {
|
|
40437
|
+
name: "moduleResolution",
|
|
40438
|
+
type: new Map(Object.entries({
|
|
40439
|
+
// N.B. The first entry specifies the value shown in `tsc --init`
|
|
40440
|
+
node10: 2 /* Node10 */,
|
|
40441
|
+
node: 2 /* Node10 */,
|
|
40442
|
+
classic: 1 /* Classic */,
|
|
40443
|
+
node16: 3 /* Node16 */,
|
|
40444
|
+
nodenext: 99 /* NodeNext */,
|
|
40445
|
+
bundler: 100 /* Bundler */
|
|
40446
|
+
})),
|
|
40447
|
+
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
40448
|
+
affectsSourceFile: true,
|
|
40449
|
+
affectsModuleResolution: true,
|
|
40450
|
+
paramType: Diagnostics.STRATEGY,
|
|
40451
|
+
category: Diagnostics.Modules,
|
|
40452
|
+
description: Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,
|
|
40453
|
+
defaultValueDescription: Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node
|
|
40454
|
+
};
|
|
40419
40455
|
var commandOptionsWithoutBuild = [
|
|
40420
40456
|
// CommandLine only options
|
|
40421
40457
|
{
|
|
@@ -40857,25 +40893,7 @@ var commandOptionsWithoutBuild = [
|
|
|
40857
40893
|
defaultValueDescription: false
|
|
40858
40894
|
},
|
|
40859
40895
|
// Module Resolution
|
|
40860
|
-
|
|
40861
|
-
name: "moduleResolution",
|
|
40862
|
-
type: new Map(Object.entries({
|
|
40863
|
-
// N.B. The first entry specifies the value shown in `tsc --init`
|
|
40864
|
-
node10: 2 /* Node10 */,
|
|
40865
|
-
node: 2 /* Node10 */,
|
|
40866
|
-
classic: 1 /* Classic */,
|
|
40867
|
-
node16: 3 /* Node16 */,
|
|
40868
|
-
nodenext: 99 /* NodeNext */,
|
|
40869
|
-
bundler: 100 /* Bundler */
|
|
40870
|
-
})),
|
|
40871
|
-
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
40872
|
-
affectsSourceFile: true,
|
|
40873
|
-
affectsModuleResolution: true,
|
|
40874
|
-
paramType: Diagnostics.STRATEGY,
|
|
40875
|
-
category: Diagnostics.Modules,
|
|
40876
|
-
description: Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,
|
|
40877
|
-
defaultValueDescription: Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node
|
|
40878
|
-
},
|
|
40896
|
+
moduleResolutionOptionDeclaration,
|
|
40879
40897
|
{
|
|
40880
40898
|
name: "baseUrl",
|
|
40881
40899
|
type: "string",
|
|
@@ -41444,6 +41462,10 @@ var configDirTemplateSubstitutionOptions = optionDeclarations.filter(
|
|
|
41444
41462
|
var configDirTemplateSubstitutionWatchOptions = optionsForWatch.filter(
|
|
41445
41463
|
(option) => option.allowConfigDirTemplateSubstitution || !option.isCommandLineOnly && option.isFilePath
|
|
41446
41464
|
);
|
|
41465
|
+
var commandLineOptionOfCustomType = optionDeclarations.filter(isCommandLineOptionOfCustomType);
|
|
41466
|
+
function isCommandLineOptionOfCustomType(option) {
|
|
41467
|
+
return !isString(option.type);
|
|
41468
|
+
}
|
|
41447
41469
|
var optionsForBuild = [
|
|
41448
41470
|
{
|
|
41449
41471
|
name: "verbose",
|
|
@@ -48855,7 +48877,7 @@ function createBinder() {
|
|
|
48855
48877
|
const reportError = (
|
|
48856
48878
|
// report error on all statements except empty ones
|
|
48857
48879
|
isStatementButNotDeclaration(node) && node.kind !== 242 /* EmptyStatement */ || // report error on class declarations
|
|
48858
|
-
node.kind === 263 /* ClassDeclaration */ ||
|
|
48880
|
+
node.kind === 263 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set
|
|
48859
48881
|
node.kind === 267 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)
|
|
48860
48882
|
);
|
|
48861
48883
|
if (reportError) {
|
|
@@ -50243,6 +50265,7 @@ function isInstantiatedModule(node, preserveConstEnums) {
|
|
|
50243
50265
|
return moduleState === 1 /* Instantiated */ || preserveConstEnums && moduleState === 2 /* ConstEnumOnly */;
|
|
50244
50266
|
}
|
|
50245
50267
|
function createTypeChecker(host) {
|
|
50268
|
+
var _a;
|
|
50246
50269
|
var deferredDiagnosticsCallbacks = [];
|
|
50247
50270
|
var addLazyDiagnostic = (arg) => {
|
|
50248
50271
|
deferredDiagnosticsCallbacks.push(arg);
|
|
@@ -50269,6 +50292,7 @@ function createTypeChecker(host) {
|
|
|
50269
50292
|
var compilerOptions = host.getCompilerOptions();
|
|
50270
50293
|
var languageVersion = getEmitScriptTarget(compilerOptions);
|
|
50271
50294
|
var moduleKind = getEmitModuleKind(compilerOptions);
|
|
50295
|
+
var moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
50272
50296
|
var legacyDecorators = !!compilerOptions.experimentalDecorators;
|
|
50273
50297
|
var useDefineForClassFields = getUseDefineForClassFields(compilerOptions);
|
|
50274
50298
|
var emitStandardClassFields = getEmitStandardClassFields(compilerOptions);
|
|
@@ -50281,6 +50305,7 @@ function createTypeChecker(host) {
|
|
|
50281
50305
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
50282
50306
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
50283
50307
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
50308
|
+
var noUncheckedIndexedAccess = compilerOptions.noUncheckedIndexedAccess;
|
|
50284
50309
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
50285
50310
|
var emitResolver = createResolver();
|
|
50286
50311
|
var nodeBuilder = createNodeBuilder();
|
|
@@ -51248,6 +51273,32 @@ function createTypeChecker(host) {
|
|
|
51248
51273
|
[".jsx", ".jsx"],
|
|
51249
51274
|
[".json", ".json"]
|
|
51250
51275
|
];
|
|
51276
|
+
var typeScriptSettingsSymbol = createSymbol(64 /* Interface */, "TypeScriptSettings", 2097152 /* SyntheticInterface */);
|
|
51277
|
+
typeScriptSettingsSymbol.declarations = [];
|
|
51278
|
+
typeScriptSettingsSymbol.members = createSymbolTable([
|
|
51279
|
+
createProperty("version", getStringLiteralType(version), 8 /* Readonly */),
|
|
51280
|
+
createProperty("versionMajorMinor", getStringLiteralType(versionMajorMinor), 8 /* Readonly */),
|
|
51281
|
+
createProperty("locale", compilerOptions.locale ? getStringLiteralType(compilerOptions.locale) : undefinedType, 8 /* Readonly */),
|
|
51282
|
+
createProperty("target", getStringLiteralType(getNameOfScriptTarget(languageVersion) ?? ""), 8 /* Readonly */),
|
|
51283
|
+
createProperty("module", getStringLiteralType(getNameOfModuleKind(moduleKind) ?? ""), 8 /* Readonly */),
|
|
51284
|
+
createProperty("moduleResolution", getStringLiteralType(getNameOfModuleResolutionKind(moduleResolutionKind) ?? ""), 8 /* Readonly */),
|
|
51285
|
+
createProperty("customConditions", createTupleType(
|
|
51286
|
+
((_a = compilerOptions.customConditions) == null ? void 0 : _a.map((cond) => getStringLiteralType(cond))) ?? emptyArray,
|
|
51287
|
+
/*elementFlags*/
|
|
51288
|
+
void 0,
|
|
51289
|
+
/*readonly*/
|
|
51290
|
+
true
|
|
51291
|
+
), 8 /* Readonly */),
|
|
51292
|
+
createProperty("esModuleInterop", getESModuleInterop(compilerOptions) ? trueType : falseType, 8 /* Readonly */),
|
|
51293
|
+
createProperty("exactOptionalPropertyTypes", exactOptionalPropertyTypes ? trueType : falseType, 8 /* Readonly */),
|
|
51294
|
+
createProperty("noImplicitAny", noImplicitAny ? trueType : falseType, 8 /* Readonly */),
|
|
51295
|
+
createProperty("noUncheckedIndexedAccess", noUncheckedIndexedAccess ? trueType : falseType, 8 /* Readonly */),
|
|
51296
|
+
createProperty("strictBindCallApply", strictBindCallApply ? trueType : falseType, 8 /* Readonly */),
|
|
51297
|
+
createProperty("strictFunctionTypes", strictFunctionTypes ? trueType : falseType, 8 /* Readonly */),
|
|
51298
|
+
createProperty("strictNullChecks", strictNullChecks ? trueType : falseType, 8 /* Readonly */),
|
|
51299
|
+
createProperty("useDefineForClassFields", useDefineForClassFields ? trueType : falseType, 8 /* Readonly */)
|
|
51300
|
+
]);
|
|
51301
|
+
globals.set(typeScriptSettingsSymbol.escapedName, typeScriptSettingsSymbol);
|
|
51251
51302
|
initializeTypeChecker();
|
|
51252
51303
|
return checker;
|
|
51253
51304
|
function getCachedType(key) {
|
|
@@ -51422,8 +51473,8 @@ function createTypeChecker(host) {
|
|
|
51422
51473
|
symbol.links.type = type;
|
|
51423
51474
|
return symbol;
|
|
51424
51475
|
}
|
|
51425
|
-
function createProperty(name, type) {
|
|
51426
|
-
const symbol = createSymbol(4 /* Property */, name);
|
|
51476
|
+
function createProperty(name, type, checkFlags) {
|
|
51477
|
+
const symbol = createSymbol(4 /* Property */, name, checkFlags);
|
|
51427
51478
|
symbol.links.type = type;
|
|
51428
51479
|
return symbol;
|
|
51429
51480
|
}
|
|
@@ -51605,9 +51656,9 @@ function createTypeChecker(host) {
|
|
|
51605
51656
|
});
|
|
51606
51657
|
}
|
|
51607
51658
|
function mergeModuleAugmentation(moduleName) {
|
|
51608
|
-
var
|
|
51659
|
+
var _a2, _b, _c;
|
|
51609
51660
|
const moduleAugmentation = moduleName.parent;
|
|
51610
|
-
if (((
|
|
51661
|
+
if (((_a2 = moduleAugmentation.symbol.declarations) == null ? void 0 : _a2[0]) !== moduleAugmentation) {
|
|
51611
51662
|
Debug.assert(moduleAugmentation.symbol.declarations.length > 1);
|
|
51612
51663
|
return;
|
|
51613
51664
|
}
|
|
@@ -51920,7 +51971,7 @@ function createTypeChecker(host) {
|
|
|
51920
51971
|
}
|
|
51921
51972
|
function onSuccessfullyResolvedSymbol(errorLocation, result, meaning, lastLocation, associatedDeclarationForContainingInitializerOrBindingName, withinDeferredContext) {
|
|
51922
51973
|
addLazyDiagnostic(() => {
|
|
51923
|
-
var
|
|
51974
|
+
var _a2;
|
|
51924
51975
|
const name = result.escapedName;
|
|
51925
51976
|
const isInExternalModule = lastLocation && isSourceFile(lastLocation) && isExternalOrCommonJsModule(lastLocation);
|
|
51926
51977
|
if (errorLocation && (meaning & 2 /* BlockScopedVariable */ || (meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 111551 /* Value */) === 111551 /* Value */)) {
|
|
@@ -51960,7 +52011,7 @@ function createTypeChecker(host) {
|
|
|
51960
52011
|
const isGlobal = getSymbol2(globals, name, meaning) === result;
|
|
51961
52012
|
const nonValueSymbol = isGlobal && isSourceFile(lastLocation) && lastLocation.locals && getSymbol2(lastLocation.locals, name, ~111551 /* Value */);
|
|
51962
52013
|
if (nonValueSymbol) {
|
|
51963
|
-
const importDecl = (
|
|
52014
|
+
const importDecl = (_a2 = nonValueSymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 276 /* ImportSpecifier */ || d.kind === 273 /* ImportClause */ || d.kind === 274 /* NamespaceImport */ || d.kind === 271 /* ImportEqualsDeclaration */);
|
|
51964
52015
|
if (importDecl && !isTypeOnlyImportDeclaration(importDecl)) {
|
|
51965
52016
|
error2(importDecl, Diagnostics.Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled, unescapeLeadingUnderscores(name));
|
|
51966
52017
|
}
|
|
@@ -52211,12 +52262,12 @@ function createTypeChecker(host) {
|
|
|
52211
52262
|
return false;
|
|
52212
52263
|
}
|
|
52213
52264
|
function checkResolvedBlockScopedVariable(result, errorLocation) {
|
|
52214
|
-
var
|
|
52265
|
+
var _a2;
|
|
52215
52266
|
Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */));
|
|
52216
52267
|
if (result.flags & (16 /* Function */ | 1 /* FunctionScopedVariable */ | 67108864 /* Assignment */) && result.flags & 32 /* Class */) {
|
|
52217
52268
|
return;
|
|
52218
52269
|
}
|
|
52219
|
-
const declaration = (
|
|
52270
|
+
const declaration = (_a2 = result.declarations) == null ? void 0 : _a2.find(
|
|
52220
52271
|
(d) => isBlockOrCatchScoped(d) || isClassLike(d) || d.kind === 266 /* EnumDeclaration */
|
|
52221
52272
|
);
|
|
52222
52273
|
if (declaration === void 0)
|
|
@@ -52398,14 +52449,14 @@ function createTypeChecker(host) {
|
|
|
52398
52449
|
}
|
|
52399
52450
|
}
|
|
52400
52451
|
function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) {
|
|
52401
|
-
var
|
|
52452
|
+
var _a2;
|
|
52402
52453
|
let exportDefaultSymbol;
|
|
52403
52454
|
if (isShorthandAmbientModuleSymbol(moduleSymbol)) {
|
|
52404
52455
|
exportDefaultSymbol = moduleSymbol;
|
|
52405
52456
|
} else {
|
|
52406
52457
|
exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
|
|
52407
52458
|
}
|
|
52408
|
-
const file = (
|
|
52459
|
+
const file = (_a2 = moduleSymbol.declarations) == null ? void 0 : _a2.find(isSourceFile);
|
|
52409
52460
|
const specifier = getModuleSpecifierForImportOrExport(node);
|
|
52410
52461
|
if (!specifier) {
|
|
52411
52462
|
return exportDefaultSymbol;
|
|
@@ -52471,8 +52522,8 @@ function createTypeChecker(host) {
|
|
|
52471
52522
|
}
|
|
52472
52523
|
}
|
|
52473
52524
|
function reportNonDefaultExport(moduleSymbol, node) {
|
|
52474
|
-
var
|
|
52475
|
-
if ((
|
|
52525
|
+
var _a2, _b, _c;
|
|
52526
|
+
if ((_a2 = moduleSymbol.exports) == null ? void 0 : _a2.has(node.symbol.escapedName)) {
|
|
52476
52527
|
error2(
|
|
52477
52528
|
node.name,
|
|
52478
52529
|
Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,
|
|
@@ -52485,8 +52536,8 @@ function createTypeChecker(host) {
|
|
|
52485
52536
|
if (exportStar) {
|
|
52486
52537
|
const defaultExport = (_c = exportStar.declarations) == null ? void 0 : _c.find(
|
|
52487
52538
|
(decl) => {
|
|
52488
|
-
var
|
|
52489
|
-
return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (
|
|
52539
|
+
var _a3, _b2;
|
|
52540
|
+
return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (_a3 = resolveExternalModuleName(decl, decl.moduleSpecifier)) == null ? void 0 : _a3.exports) == null ? void 0 : _b2.has("default" /* Default */)));
|
|
52490
52541
|
}
|
|
52491
52542
|
);
|
|
52492
52543
|
if (defaultExport) {
|
|
@@ -52553,11 +52604,11 @@ function createTypeChecker(host) {
|
|
|
52553
52604
|
return result;
|
|
52554
52605
|
}
|
|
52555
52606
|
function getExportOfModule(symbol, name, specifier, dontResolveAlias) {
|
|
52556
|
-
var
|
|
52607
|
+
var _a2;
|
|
52557
52608
|
if (symbol.flags & 1536 /* Module */) {
|
|
52558
52609
|
const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText);
|
|
52559
52610
|
const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
|
|
52560
|
-
const exportStarDeclaration = (
|
|
52611
|
+
const exportStarDeclaration = (_a2 = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a2.get(name.escapedText);
|
|
52561
52612
|
markSymbolOfAliasDeclarationIfTypeOnly(
|
|
52562
52613
|
specifier,
|
|
52563
52614
|
exportSymbol,
|
|
@@ -52579,7 +52630,7 @@ function createTypeChecker(host) {
|
|
|
52579
52630
|
}
|
|
52580
52631
|
}
|
|
52581
52632
|
function getExternalModuleMember(node, specifier, dontResolveAlias = false) {
|
|
52582
|
-
var
|
|
52633
|
+
var _a2;
|
|
52583
52634
|
const moduleSpecifier = getExternalModuleRequireArgument(node) || node.moduleSpecifier;
|
|
52584
52635
|
const moduleSymbol = resolveExternalModuleName(node, moduleSpecifier);
|
|
52585
52636
|
const name = !isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name;
|
|
@@ -52613,7 +52664,7 @@ function createTypeChecker(host) {
|
|
|
52613
52664
|
symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias);
|
|
52614
52665
|
let symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);
|
|
52615
52666
|
if (symbolFromModule === void 0 && name.escapedText === "default" /* Default */) {
|
|
52616
|
-
const file = (
|
|
52667
|
+
const file = (_a2 = moduleSymbol.declarations) == null ? void 0 : _a2.find(isSourceFile);
|
|
52617
52668
|
if (isOnlyImportableAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
52618
52669
|
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
52619
52670
|
}
|
|
@@ -52627,7 +52678,7 @@ function createTypeChecker(host) {
|
|
|
52627
52678
|
}
|
|
52628
52679
|
}
|
|
52629
52680
|
function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name) {
|
|
52630
|
-
var
|
|
52681
|
+
var _a2;
|
|
52631
52682
|
const moduleName = getFullyQualifiedName(moduleSymbol, node);
|
|
52632
52683
|
const declarationName = declarationNameToString(name);
|
|
52633
52684
|
const suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
@@ -52638,7 +52689,7 @@ function createTypeChecker(host) {
|
|
|
52638
52689
|
addRelatedInfo(diagnostic, createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName));
|
|
52639
52690
|
}
|
|
52640
52691
|
} else {
|
|
52641
|
-
if ((
|
|
52692
|
+
if ((_a2 = moduleSymbol.exports) == null ? void 0 : _a2.has("default" /* Default */)) {
|
|
52642
52693
|
error2(
|
|
52643
52694
|
name,
|
|
52644
52695
|
Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,
|
|
@@ -52651,8 +52702,8 @@ function createTypeChecker(host) {
|
|
|
52651
52702
|
}
|
|
52652
52703
|
}
|
|
52653
52704
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
52654
|
-
var
|
|
52655
|
-
const localSymbol = (_b = (
|
|
52705
|
+
var _a2, _b;
|
|
52706
|
+
const localSymbol = (_b = (_a2 = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a2.locals) == null ? void 0 : _b.get(name.escapedText);
|
|
52656
52707
|
const exports2 = moduleSymbol.exports;
|
|
52657
52708
|
if (localSymbol) {
|
|
52658
52709
|
const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */);
|
|
@@ -52919,9 +52970,9 @@ function createTypeChecker(host) {
|
|
|
52919
52970
|
return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty);
|
|
52920
52971
|
}
|
|
52921
52972
|
function markSymbolOfAliasDeclarationIfTypeOnlyWorker(aliasDeclarationLinks, target, overwriteEmpty) {
|
|
52922
|
-
var
|
|
52973
|
+
var _a2;
|
|
52923
52974
|
if (target && (aliasDeclarationLinks.typeOnlyDeclaration === void 0 || overwriteEmpty && aliasDeclarationLinks.typeOnlyDeclaration === false)) {
|
|
52924
|
-
const exportSymbol = ((
|
|
52975
|
+
const exportSymbol = ((_a2 = target.exports) == null ? void 0 : _a2.get("export=" /* ExportEquals */)) ?? target;
|
|
52925
52976
|
const typeOnly = exportSymbol.declarations && find(exportSymbol.declarations, isTypeOnlyImportOrExportDeclaration);
|
|
52926
52977
|
aliasDeclarationLinks.typeOnlyDeclaration = typeOnly ?? getSymbolLinks(exportSymbol).typeOnlyDeclaration ?? false;
|
|
52927
52978
|
}
|
|
@@ -53218,7 +53269,7 @@ function createTypeChecker(host) {
|
|
|
53218
53269
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
53219
53270
|
}
|
|
53220
53271
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
53221
|
-
var
|
|
53272
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
53222
53273
|
if (startsWith(moduleReference, "@types/")) {
|
|
53223
53274
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
53224
53275
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -53233,13 +53284,13 @@ function createTypeChecker(host) {
|
|
|
53233
53284
|
return ambientModule;
|
|
53234
53285
|
}
|
|
53235
53286
|
const currentSourceFile = getSourceFileOfNode(location);
|
|
53236
|
-
const contextSpecifier = isStringLiteralLike(location) ? location : ((
|
|
53287
|
+
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a2 = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a2.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isInJSFile(location) && isJSDocImportTag(location) ? location.moduleSpecifier : void 0) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
|
|
53237
53288
|
location.initializer,
|
|
53238
53289
|
/*requireStringLiteralLikeArgument*/
|
|
53239
53290
|
true
|
|
53240
53291
|
) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, isImportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression) || ((_f = findAncestor(location, isExportDeclaration)) == null ? void 0 : _f.moduleSpecifier);
|
|
53241
53292
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
|
|
53242
|
-
const
|
|
53293
|
+
const moduleResolutionKind2 = getEmitModuleResolutionKind(compilerOptions);
|
|
53243
53294
|
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
53244
53295
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
53245
53296
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
@@ -53275,7 +53326,7 @@ function createTypeChecker(host) {
|
|
|
53275
53326
|
moduleReference
|
|
53276
53327
|
);
|
|
53277
53328
|
}
|
|
53278
|
-
if (
|
|
53329
|
+
if (moduleResolutionKind2 === 3 /* Node16 */ || moduleResolutionKind2 === 99 /* NodeNext */) {
|
|
53279
53330
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
53280
53331
|
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
53281
53332
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
@@ -53379,8 +53430,8 @@ function createTypeChecker(host) {
|
|
|
53379
53430
|
error2(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
53380
53431
|
} else {
|
|
53381
53432
|
const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference);
|
|
53382
|
-
const resolutionIsNode16OrNext =
|
|
53383
|
-
if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) &&
|
|
53433
|
+
const resolutionIsNode16OrNext = moduleResolutionKind2 === 3 /* Node16 */ || moduleResolutionKind2 === 99 /* NodeNext */;
|
|
53434
|
+
if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind2 !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) {
|
|
53384
53435
|
error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
53385
53436
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
53386
53437
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
@@ -53466,7 +53517,7 @@ function createTypeChecker(host) {
|
|
|
53466
53517
|
return links.cjsExportMerged = merged;
|
|
53467
53518
|
}
|
|
53468
53519
|
function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) {
|
|
53469
|
-
var
|
|
53520
|
+
var _a2;
|
|
53470
53521
|
const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
|
|
53471
53522
|
if (!dontResolveAlias && symbol) {
|
|
53472
53523
|
if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 307 /* SourceFile */)) {
|
|
@@ -53482,7 +53533,7 @@ function createTypeChecker(host) {
|
|
|
53482
53533
|
if (defaultOnlyType) {
|
|
53483
53534
|
return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent);
|
|
53484
53535
|
}
|
|
53485
|
-
const targetFile = (
|
|
53536
|
+
const targetFile = (_a2 = moduleSymbol == null ? void 0 : moduleSymbol.declarations) == null ? void 0 : _a2.find(isSourceFile);
|
|
53486
53537
|
const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(getEmitSyntaxForModuleSpecifierExpression(reference), host.getImpliedNodeFormatForEmit(targetFile));
|
|
53487
53538
|
if (getESModuleInterop(compilerOptions) || isEsmCjsRef) {
|
|
53488
53539
|
let sigs = getSignaturesOfStructuredType(type, 0 /* Call */);
|
|
@@ -53691,8 +53742,8 @@ function createTypeChecker(host) {
|
|
|
53691
53742
|
return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent));
|
|
53692
53743
|
}
|
|
53693
53744
|
function getFunctionExpressionParentSymbolOrSymbol(symbol) {
|
|
53694
|
-
var
|
|
53695
|
-
return ((
|
|
53745
|
+
var _a2, _b;
|
|
53746
|
+
return ((_a2 = symbol.valueDeclaration) == null ? void 0 : _a2.kind) === 219 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 218 /* FunctionExpression */ ? getSymbolOfNode(symbol.valueDeclaration.parent) || symbol : symbol;
|
|
53696
53747
|
}
|
|
53697
53748
|
function getAlternativeContainingModules(symbol, enclosingDeclaration) {
|
|
53698
53749
|
const containingFile = getSourceFileOfNode(enclosingDeclaration);
|
|
@@ -53846,11 +53897,11 @@ function createTypeChecker(host) {
|
|
|
53846
53897
|
return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getSymbolFlags(symbol, !includeTypeOnlyMembers) & 111551 /* Value */);
|
|
53847
53898
|
}
|
|
53848
53899
|
function createType(flags) {
|
|
53849
|
-
var
|
|
53900
|
+
var _a2;
|
|
53850
53901
|
const result = new Type29(checker, flags);
|
|
53851
53902
|
typeCount++;
|
|
53852
53903
|
result.id = typeCount;
|
|
53853
|
-
(
|
|
53904
|
+
(_a2 = tracing) == null ? void 0 : _a2.recordType(result);
|
|
53854
53905
|
return result;
|
|
53855
53906
|
}
|
|
53856
53907
|
function createTypeWithSymbol(flags, symbol) {
|
|
@@ -54269,7 +54320,7 @@ function createTypeChecker(host) {
|
|
|
54269
54320
|
}
|
|
54270
54321
|
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible };
|
|
54271
54322
|
function getIsDeclarationVisible(declaration) {
|
|
54272
|
-
var
|
|
54323
|
+
var _a2, _b;
|
|
54273
54324
|
if (!isDeclarationVisible(declaration)) {
|
|
54274
54325
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
54275
54326
|
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
@@ -54281,7 +54332,7 @@ function createTypeChecker(host) {
|
|
|
54281
54332
|
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration, 32 /* Export */) && isDeclarationVisible(declaration.parent)) {
|
|
54282
54333
|
return addVisibleAlias(declaration, declaration);
|
|
54283
54334
|
} else if (isBindingElement(declaration)) {
|
|
54284
|
-
if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((
|
|
54335
|
+
if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a2 = declaration.parent) == null ? void 0 : _a2.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier(declaration.parent.parent.parent.parent, 32 /* Export */) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) {
|
|
54285
54336
|
return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
|
|
54286
54337
|
} else if (symbol.flags & 2 /* BlockScopedVariable */) {
|
|
54287
54338
|
const variableStatement = findAncestor(declaration, isVariableStatement);
|
|
@@ -54600,7 +54651,7 @@ function createTypeChecker(host) {
|
|
|
54600
54651
|
return typeNode;
|
|
54601
54652
|
}
|
|
54602
54653
|
function typeToTypeNodeWorker(type, context) {
|
|
54603
|
-
var
|
|
54654
|
+
var _a2, _b;
|
|
54604
54655
|
if (cancellationToken && cancellationToken.throwIfCancellationRequested) {
|
|
54605
54656
|
cancellationToken.throwIfCancellationRequested();
|
|
54606
54657
|
}
|
|
@@ -54734,7 +54785,7 @@ function createTypeChecker(host) {
|
|
|
54734
54785
|
if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) {
|
|
54735
54786
|
context.encounteredError = true;
|
|
54736
54787
|
}
|
|
54737
|
-
(_b = (
|
|
54788
|
+
(_b = (_a2 = context.tracker).reportInaccessibleThisError) == null ? void 0 : _b.call(_a2);
|
|
54738
54789
|
}
|
|
54739
54790
|
context.approximateLength += 4;
|
|
54740
54791
|
return factory.createThisTypeNode();
|
|
@@ -54899,9 +54950,9 @@ function createTypeChecker(host) {
|
|
|
54899
54950
|
return factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
|
|
54900
54951
|
}
|
|
54901
54952
|
function typeToTypeNodeOrCircularityElision(type2) {
|
|
54902
|
-
var
|
|
54953
|
+
var _a3, _b2, _c;
|
|
54903
54954
|
if (type2.flags & 1048576 /* Union */) {
|
|
54904
|
-
if ((
|
|
54955
|
+
if ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(getTypeId(type2))) {
|
|
54905
54956
|
if (!(context.flags & 131072 /* AllowAnonymousIdentifier */)) {
|
|
54906
54957
|
context.encounteredError = true;
|
|
54907
54958
|
(_c = (_b2 = context.tracker) == null ? void 0 : _b2.reportCyclicStructureError) == null ? void 0 : _c.call(_b2);
|
|
@@ -54919,13 +54970,13 @@ function createTypeChecker(host) {
|
|
|
54919
54970
|
return !!type2.target && isMappedTypeHomomorphic(type2.target) && !isMappedTypeHomomorphic(type2);
|
|
54920
54971
|
}
|
|
54921
54972
|
function createMappedTypeNodeFromType(type2) {
|
|
54922
|
-
var
|
|
54973
|
+
var _a3;
|
|
54923
54974
|
Debug.assert(!!(type2.flags & 524288 /* Object */));
|
|
54924
54975
|
const readonlyToken = type2.declaration.readonlyToken ? factory.createToken(type2.declaration.readonlyToken.kind) : void 0;
|
|
54925
54976
|
const questionToken = type2.declaration.questionToken ? factory.createToken(type2.declaration.questionToken.kind) : void 0;
|
|
54926
54977
|
let appropriateConstraintTypeNode;
|
|
54927
54978
|
let newTypeVariable;
|
|
54928
|
-
const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type2) && !(getModifiersTypeFromMappedType(type2).flags & 2 /* Unknown */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && !(getConstraintTypeFromMappedType(type2).flags & 262144 /* TypeParameter */ && ((
|
|
54979
|
+
const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type2) && !(getModifiersTypeFromMappedType(type2).flags & 2 /* Unknown */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && !(getConstraintTypeFromMappedType(type2).flags & 262144 /* TypeParameter */ && ((_a3 = getConstraintOfTypeParameter(getConstraintTypeFromMappedType(type2))) == null ? void 0 : _a3.flags) & 4194304 /* Index */);
|
|
54929
54980
|
if (isMappedTypeWithKeyofConstraintDeclaration(type2)) {
|
|
54930
54981
|
if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type2) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
54931
54982
|
const newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T"));
|
|
@@ -54984,7 +55035,7 @@ function createTypeChecker(host) {
|
|
|
54984
55035
|
return result;
|
|
54985
55036
|
}
|
|
54986
55037
|
function createAnonymousTypeNode(type2) {
|
|
54987
|
-
var
|
|
55038
|
+
var _a3, _b2;
|
|
54988
55039
|
const typeId = type2.id;
|
|
54989
55040
|
const symbol = type2.symbol;
|
|
54990
55041
|
if (symbol) {
|
|
@@ -54998,7 +55049,7 @@ function createTypeChecker(host) {
|
|
|
54998
55049
|
return typeNode;
|
|
54999
55050
|
}
|
|
55000
55051
|
}
|
|
55001
|
-
if ((
|
|
55052
|
+
if ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(typeId)) {
|
|
55002
55053
|
return createElidedInformationPlaceholder(context);
|
|
55003
55054
|
}
|
|
55004
55055
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
@@ -55028,19 +55079,19 @@ function createTypeChecker(host) {
|
|
|
55028
55079
|
return createTypeNodeFromObjectType(type2);
|
|
55029
55080
|
}
|
|
55030
55081
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
55031
|
-
var
|
|
55082
|
+
var _a4;
|
|
55032
55083
|
const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method
|
|
55033
55084
|
some(symbol.declarations, (declaration) => isStatic(declaration));
|
|
55034
55085
|
const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
|
|
55035
55086
|
forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */));
|
|
55036
55087
|
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
|
|
55037
|
-
return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((
|
|
55088
|
+
return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a4 = context.visitedTypes) == null ? void 0 : _a4.has(typeId))) && // it is type of the symbol uses itself recursively
|
|
55038
55089
|
(!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
|
|
55039
55090
|
}
|
|
55040
55091
|
}
|
|
55041
55092
|
}
|
|
55042
55093
|
function visitAndTransformType(type2, transform2) {
|
|
55043
|
-
var
|
|
55094
|
+
var _a3, _b2, _c;
|
|
55044
55095
|
const typeId = type2.id;
|
|
55045
55096
|
const isConstructorObject = getObjectFlags(type2) & 16 /* Anonymous */ && type2.symbol && type2.symbol.flags & 32 /* Class */;
|
|
55046
55097
|
const id = getObjectFlags(type2) & 4 /* Reference */ && type2.node ? "N" + getNodeId(type2.node) : type2.flags & 16777216 /* Conditional */ ? "N" + getNodeId(type2.root.node) : type2.symbol ? (isConstructorObject ? "+" : "") + getSymbolId(type2.symbol) : void 0;
|
|
@@ -55055,7 +55106,7 @@ function createTypeChecker(host) {
|
|
|
55055
55106
|
if (links) {
|
|
55056
55107
|
links.serializedTypes || (links.serializedTypes = /* @__PURE__ */ new Map());
|
|
55057
55108
|
}
|
|
55058
|
-
const cachedResult = (
|
|
55109
|
+
const cachedResult = (_a3 = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _a3.get(key);
|
|
55059
55110
|
if (cachedResult) {
|
|
55060
55111
|
(_b2 = cachedResult.trackedSymbols) == null ? void 0 : _b2.forEach(
|
|
55061
55112
|
([symbol, enclosingDeclaration, meaning]) => context.tracker.trackSymbol(
|
|
@@ -55374,11 +55425,11 @@ function createTypeChecker(host) {
|
|
|
55374
55425
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
55375
55426
|
}
|
|
55376
55427
|
function shouldUsePlaceholderForProperty(propertySymbol, context) {
|
|
55377
|
-
var
|
|
55378
|
-
return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((
|
|
55428
|
+
var _a2;
|
|
55429
|
+
return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((_a2 = context.reverseMappedStack) == null ? void 0 : _a2[0]) && !(getObjectFlags(last(context.reverseMappedStack).links.propertyType) & 16 /* Anonymous */));
|
|
55379
55430
|
}
|
|
55380
55431
|
function addPropertyToElementList(propertySymbol, context, typeElements) {
|
|
55381
|
-
var
|
|
55432
|
+
var _a2;
|
|
55382
55433
|
const propertyIsReverseMapped = !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */);
|
|
55383
55434
|
const propertyType = shouldUsePlaceholderForProperty(propertySymbol, context) ? anyType : getNonMissingTypeOfSymbol(propertySymbol);
|
|
55384
55435
|
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
@@ -55400,7 +55451,7 @@ function createTypeChecker(host) {
|
|
|
55400
55451
|
context.tracker.reportNonSerializableProperty(symbolToString(propertySymbol));
|
|
55401
55452
|
}
|
|
55402
55453
|
}
|
|
55403
|
-
context.enclosingDeclaration = propertySymbol.valueDeclaration || ((
|
|
55454
|
+
context.enclosingDeclaration = propertySymbol.valueDeclaration || ((_a2 = propertySymbol.declarations) == null ? void 0 : _a2[0]) || saveEnclosingDeclaration;
|
|
55404
55455
|
const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);
|
|
55405
55456
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
55406
55457
|
context.approximateLength += symbolName(propertySymbol).length + 1;
|
|
@@ -55468,8 +55519,8 @@ function createTypeChecker(host) {
|
|
|
55468
55519
|
);
|
|
55469
55520
|
typeElements.push(preserveCommentsOn(propertySignature));
|
|
55470
55521
|
function preserveCommentsOn(node) {
|
|
55471
|
-
var
|
|
55472
|
-
const jsdocPropertyTag = (
|
|
55522
|
+
var _a3;
|
|
55523
|
+
const jsdocPropertyTag = (_a3 = propertySymbol.declarations) == null ? void 0 : _a3.find((d) => d.kind === 348 /* JSDocPropertyTag */);
|
|
55473
55524
|
if (jsdocPropertyTag) {
|
|
55474
55525
|
const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment);
|
|
55475
55526
|
if (commentText) {
|
|
@@ -55576,7 +55627,7 @@ function createTypeChecker(host) {
|
|
|
55576
55627
|
);
|
|
55577
55628
|
}
|
|
55578
55629
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
55579
|
-
var
|
|
55630
|
+
var _a2;
|
|
55580
55631
|
const flags = context.flags;
|
|
55581
55632
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
55582
55633
|
context.approximateLength += 3;
|
|
@@ -55666,7 +55717,7 @@ function createTypeChecker(host) {
|
|
|
55666
55717
|
if (typeArguments) {
|
|
55667
55718
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
55668
55719
|
}
|
|
55669
|
-
if (((
|
|
55720
|
+
if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 323 /* JSDocSignature */ && signature.declaration.parent.kind === 339 /* JSDocOverloadTag */) {
|
|
55670
55721
|
const comment = getTextOfNode(
|
|
55671
55722
|
signature.declaration.parent.parent,
|
|
55672
55723
|
/*includeTrivia*/
|
|
@@ -55998,11 +56049,11 @@ function createTypeChecker(host) {
|
|
|
55998
56049
|
return typeParameterNodes;
|
|
55999
56050
|
}
|
|
56000
56051
|
function lookupTypeParameterNodes(chain, index, context) {
|
|
56001
|
-
var
|
|
56052
|
+
var _a2;
|
|
56002
56053
|
Debug.assert(chain && 0 <= index && index < chain.length);
|
|
56003
56054
|
const symbol = chain[index];
|
|
56004
56055
|
const symbolId = getSymbolId(symbol);
|
|
56005
|
-
if ((
|
|
56056
|
+
if ((_a2 = context.typeParameterSymbolList) == null ? void 0 : _a2.has(symbolId)) {
|
|
56006
56057
|
return void 0;
|
|
56007
56058
|
}
|
|
56008
56059
|
(context.typeParameterSymbolList || (context.typeParameterSymbolList = /* @__PURE__ */ new Set())).add(symbolId);
|
|
@@ -56237,7 +56288,7 @@ function createTypeChecker(host) {
|
|
|
56237
56288
|
return false;
|
|
56238
56289
|
}
|
|
56239
56290
|
function typeParameterToName(type, context) {
|
|
56240
|
-
var
|
|
56291
|
+
var _a2, _b;
|
|
56241
56292
|
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && context.typeParameterNames) {
|
|
56242
56293
|
const cached = context.typeParameterNames.get(getTypeId(type));
|
|
56243
56294
|
if (cached) {
|
|
@@ -56256,7 +56307,7 @@ function createTypeChecker(host) {
|
|
|
56256
56307
|
}
|
|
56257
56308
|
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
56258
56309
|
const rawtext = result.escapedText;
|
|
56259
|
-
let i = ((
|
|
56310
|
+
let i = ((_a2 = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _a2.get(rawtext)) || 0;
|
|
56260
56311
|
let text = rawtext;
|
|
56261
56312
|
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsOtherTypeParameterInScope(text, context, type)) {
|
|
56262
56313
|
i++;
|
|
@@ -56432,7 +56483,7 @@ function createTypeChecker(host) {
|
|
|
56432
56483
|
return enclosingDeclaration;
|
|
56433
56484
|
}
|
|
56434
56485
|
function serializeTypeForDeclaration(context, declaration, type, symbol) {
|
|
56435
|
-
var
|
|
56486
|
+
var _a2;
|
|
56436
56487
|
const addUndefined = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration);
|
|
56437
56488
|
const enclosingDeclaration = context.enclosingDeclaration;
|
|
56438
56489
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
@@ -56449,7 +56500,7 @@ function createTypeChecker(host) {
|
|
|
56449
56500
|
if (type.flags & 8192 /* UniqueESSymbol */ && type.symbol === symbol && (!context.enclosingDeclaration || some(symbol.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)))) {
|
|
56450
56501
|
context.flags |= 1048576 /* AllowUniqueESSymbolType */;
|
|
56451
56502
|
}
|
|
56452
|
-
const decl = declaration ?? symbol.valueDeclaration ?? ((
|
|
56503
|
+
const decl = declaration ?? symbol.valueDeclaration ?? ((_a2 = symbol.declarations) == null ? void 0 : _a2[0]);
|
|
56453
56504
|
const expr = decl && isDeclarationWithPossibleInnerTypeNodeReuse(decl) ? getPossibleTypeNodeReuseExpression(decl) : void 0;
|
|
56454
56505
|
if (decl && hasInferredType(decl) && !(context.flags & -2147483648 /* NoSyntacticPrinter */)) {
|
|
56455
56506
|
syntacticNodeBuilder.serializeTypeOfDeclaration(decl, context);
|
|
@@ -56810,7 +56861,7 @@ function createTypeChecker(host) {
|
|
|
56810
56861
|
}
|
|
56811
56862
|
}
|
|
56812
56863
|
function symbolTableToDeclarationStatements(symbolTable, context) {
|
|
56813
|
-
var
|
|
56864
|
+
var _a2;
|
|
56814
56865
|
const serializePropertySymbolForClass = makeSerializePropertySymbol(
|
|
56815
56866
|
factory.createPropertyDeclaration,
|
|
56816
56867
|
174 /* MethodDeclaration */,
|
|
@@ -56832,14 +56883,14 @@ function createTypeChecker(host) {
|
|
|
56832
56883
|
...oldcontext,
|
|
56833
56884
|
usedSymbolNames: new Set(oldcontext.usedSymbolNames),
|
|
56834
56885
|
remappedSymbolNames: /* @__PURE__ */ new Map(),
|
|
56835
|
-
remappedSymbolReferences: new Map((
|
|
56886
|
+
remappedSymbolReferences: new Map((_a2 = oldcontext.remappedSymbolReferences) == null ? void 0 : _a2.entries()),
|
|
56836
56887
|
tracker: void 0
|
|
56837
56888
|
};
|
|
56838
56889
|
const tracker = {
|
|
56839
56890
|
...oldcontext.tracker.inner,
|
|
56840
56891
|
trackSymbol: (sym, decl, meaning) => {
|
|
56841
|
-
var
|
|
56842
|
-
if ((
|
|
56892
|
+
var _a3, _b;
|
|
56893
|
+
if ((_a3 = context.remappedSymbolNames) == null ? void 0 : _a3.has(getSymbolId(sym)))
|
|
56843
56894
|
return false;
|
|
56844
56895
|
const accessibleResult = isSymbolAccessible(
|
|
56845
56896
|
sym,
|
|
@@ -57074,7 +57125,7 @@ function createTypeChecker(host) {
|
|
|
57074
57125
|
}
|
|
57075
57126
|
}
|
|
57076
57127
|
function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) {
|
|
57077
|
-
var
|
|
57128
|
+
var _a3, _b, _c, _d, _e, _f;
|
|
57078
57129
|
const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName);
|
|
57079
57130
|
const isDefault = escapedSymbolName === "default" /* Default */;
|
|
57080
57131
|
if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && isStringANonContextualKeyword(symbolName2) && !isDefault) {
|
|
@@ -57105,7 +57156,7 @@ function createTypeChecker(host) {
|
|
|
57105
57156
|
} else {
|
|
57106
57157
|
const type = getTypeOfSymbol(symbol);
|
|
57107
57158
|
const localName = getInternalSymbolName(symbol, symbolName2);
|
|
57108
|
-
if (type.symbol && type.symbol !== symbol && type.symbol.flags & 16 /* Function */ && some(type.symbol.declarations, isFunctionExpressionOrArrowFunction) && (((
|
|
57159
|
+
if (type.symbol && type.symbol !== symbol && type.symbol.flags & 16 /* Function */ && some(type.symbol.declarations, isFunctionExpressionOrArrowFunction) && (((_a3 = type.symbol.members) == null ? void 0 : _a3.size) || ((_b = type.symbol.exports) == null ? void 0 : _b.size))) {
|
|
57109
57160
|
if (!context.remappedSymbolReferences) {
|
|
57110
57161
|
context.remappedSymbolReferences = /* @__PURE__ */ new Map();
|
|
57111
57162
|
}
|
|
@@ -57284,11 +57335,11 @@ function createTypeChecker(host) {
|
|
|
57284
57335
|
results.push(node);
|
|
57285
57336
|
}
|
|
57286
57337
|
function serializeTypeAlias(symbol, symbolName2, modifierFlags) {
|
|
57287
|
-
var
|
|
57338
|
+
var _a3;
|
|
57288
57339
|
const aliasType = getDeclaredTypeOfTypeAlias(symbol);
|
|
57289
57340
|
const typeParams = getSymbolLinks(symbol).typeParameters;
|
|
57290
57341
|
const typeParamDecls = map(typeParams, (p) => typeParameterToDeclaration(p, context));
|
|
57291
|
-
const jsdocAliasDecl = (
|
|
57342
|
+
const jsdocAliasDecl = (_a3 = symbol.declarations) == null ? void 0 : _a3.find(isJSDocTypeAlias);
|
|
57292
57343
|
const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0);
|
|
57293
57344
|
const oldFlags = context.flags;
|
|
57294
57345
|
context.flags |= 8388608 /* InTypeAlias */;
|
|
@@ -57375,12 +57426,12 @@ function createTypeChecker(host) {
|
|
|
57375
57426
|
/*isTypeOnly*/
|
|
57376
57427
|
false,
|
|
57377
57428
|
factory.createNamedExports(mapDefined(filter(mergedMembers, (n) => n.escapedName !== "export=" /* ExportEquals */), (s) => {
|
|
57378
|
-
var
|
|
57429
|
+
var _a3, _b;
|
|
57379
57430
|
const name = unescapeLeadingUnderscores(s.escapedName);
|
|
57380
57431
|
const localName2 = getInternalSymbolName(s, name);
|
|
57381
57432
|
const aliasDecl = s.declarations && getDeclarationOfAliasSymbol(s);
|
|
57382
57433
|
if (containingFile && (aliasDecl ? containingFile !== getSourceFileOfNode(aliasDecl) : !some(s.declarations, (d) => getSourceFileOfNode(d) === containingFile))) {
|
|
57383
|
-
(_b = (
|
|
57434
|
+
(_b = (_a3 = context.tracker) == null ? void 0 : _a3.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a3, containingFile, symbol, s);
|
|
57384
57435
|
return void 0;
|
|
57385
57436
|
}
|
|
57386
57437
|
const target = aliasDecl && getTargetOfAliasDeclaration(
|
|
@@ -57546,8 +57597,8 @@ function createTypeChecker(host) {
|
|
|
57546
57597
|
return void 0;
|
|
57547
57598
|
}
|
|
57548
57599
|
function serializeAsClass(symbol, localName, modifierFlags) {
|
|
57549
|
-
var
|
|
57550
|
-
const originalDecl = (
|
|
57600
|
+
var _a3, _b;
|
|
57601
|
+
const originalDecl = (_a3 = symbol.declarations) == null ? void 0 : _a3.find(isClassLike);
|
|
57551
57602
|
const oldEnclosing = context.enclosingDeclaration;
|
|
57552
57603
|
context.enclosingDeclaration = originalDecl || oldEnclosing;
|
|
57553
57604
|
const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
|
|
@@ -57644,7 +57695,7 @@ function createTypeChecker(host) {
|
|
|
57644
57695
|
});
|
|
57645
57696
|
}
|
|
57646
57697
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
57647
|
-
var
|
|
57698
|
+
var _a3, _b, _c, _d, _e, _f;
|
|
57648
57699
|
const node = getDeclarationOfAliasSymbol(symbol);
|
|
57649
57700
|
if (!node)
|
|
57650
57701
|
return Debug.fail();
|
|
@@ -57664,7 +57715,7 @@ function createTypeChecker(host) {
|
|
|
57664
57715
|
includePrivateSymbol(target);
|
|
57665
57716
|
switch (node.kind) {
|
|
57666
57717
|
case 208 /* BindingElement */:
|
|
57667
|
-
if (((_b = (
|
|
57718
|
+
if (((_b = (_a3 = node.parent) == null ? void 0 : _a3.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) {
|
|
57668
57719
|
const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
57669
57720
|
const { propertyName } = node;
|
|
57670
57721
|
addResult(
|
|
@@ -57887,7 +57938,7 @@ function createTypeChecker(host) {
|
|
|
57887
57938
|
);
|
|
57888
57939
|
}
|
|
57889
57940
|
function serializeMaybeAliasAssignment(symbol) {
|
|
57890
|
-
var
|
|
57941
|
+
var _a3;
|
|
57891
57942
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
57892
57943
|
return false;
|
|
57893
57944
|
}
|
|
@@ -57960,7 +58011,7 @@ function createTypeChecker(host) {
|
|
|
57960
58011
|
if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {
|
|
57961
58012
|
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */);
|
|
57962
58013
|
} else {
|
|
57963
|
-
const flags = ((
|
|
58014
|
+
const flags = ((_a3 = context.enclosingDeclaration) == null ? void 0 : _a3.kind) === 267 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */;
|
|
57964
58015
|
const statement = factory.createVariableStatement(
|
|
57965
58016
|
/*modifiers*/
|
|
57966
58017
|
void 0,
|
|
@@ -58000,9 +58051,9 @@ function createTypeChecker(host) {
|
|
|
58000
58051
|
}
|
|
58001
58052
|
}
|
|
58002
58053
|
function isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, hostSymbol) {
|
|
58003
|
-
var
|
|
58054
|
+
var _a3;
|
|
58004
58055
|
const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
|
|
58005
|
-
return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !some((
|
|
58056
|
+
return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !some((_a3 = typeToSerialize.symbol) == null ? void 0 : _a3.declarations, isTypeNode) && // If the type comes straight from a type node, we shouldn't try to break it up
|
|
58006
58057
|
!length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class
|
|
58007
58058
|
!!(length(filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK
|
|
58008
58059
|
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => {
|
|
@@ -58017,7 +58068,7 @@ function createTypeChecker(host) {
|
|
|
58017
58068
|
}
|
|
58018
58069
|
function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
|
|
58019
58070
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
58020
|
-
var
|
|
58071
|
+
var _a3, _b, _c, _d, _e;
|
|
58021
58072
|
const modifierFlags = getDeclarationModifierFlagsFromSymbol(p);
|
|
58022
58073
|
const isPrivate = !!(modifierFlags & 2 /* Private */);
|
|
58023
58074
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
@@ -58028,7 +58079,7 @@ function createTypeChecker(host) {
|
|
|
58028
58079
|
}
|
|
58029
58080
|
const flag = modifierFlags & ~1024 /* Async */ | (isStatic2 ? 256 /* Static */ : 0);
|
|
58030
58081
|
const name = getPropertyNameNodeForSymbol(p, context);
|
|
58031
|
-
const firstPropertyLikeDecl = (
|
|
58082
|
+
const firstPropertyLikeDecl = (_a3 = p.declarations) == null ? void 0 : _a3.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
|
|
58032
58083
|
if (p.flags & 98304 /* Accessor */ && useAccessors) {
|
|
58033
58084
|
const result = [];
|
|
58034
58085
|
if (p.flags & 65536 /* SetAccessor */) {
|
|
@@ -58297,7 +58348,7 @@ function createTypeChecker(host) {
|
|
|
58297
58348
|
}
|
|
58298
58349
|
}
|
|
58299
58350
|
function getUnusedName(input, symbol) {
|
|
58300
|
-
var
|
|
58351
|
+
var _a3, _b;
|
|
58301
58352
|
const id = symbol ? getSymbolId(symbol) : void 0;
|
|
58302
58353
|
if (id) {
|
|
58303
58354
|
if (context.remappedSymbolNames.has(id)) {
|
|
@@ -58309,7 +58360,7 @@ function createTypeChecker(host) {
|
|
|
58309
58360
|
}
|
|
58310
58361
|
let i = 0;
|
|
58311
58362
|
const original = input;
|
|
58312
|
-
while ((
|
|
58363
|
+
while ((_a3 = context.usedSymbolNames) == null ? void 0 : _a3.has(input)) {
|
|
58313
58364
|
i++;
|
|
58314
58365
|
input = `${original}_${i}`;
|
|
58315
58366
|
}
|
|
@@ -58433,8 +58484,8 @@ function createTypeChecker(host) {
|
|
|
58433
58484
|
}
|
|
58434
58485
|
}
|
|
58435
58486
|
function getNameOfSymbolAsWritten(symbol, context) {
|
|
58436
|
-
var
|
|
58437
|
-
if ((
|
|
58487
|
+
var _a2;
|
|
58488
|
+
if ((_a2 = context == null ? void 0 : context.remappedSymbolReferences) == null ? void 0 : _a2.has(getSymbolId(symbol))) {
|
|
58438
58489
|
symbol = context.remappedSymbolReferences.get(getSymbolId(symbol));
|
|
58439
58490
|
}
|
|
58440
58491
|
if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && // If it's not the first part of an entity name, it must print as `default`
|
|
@@ -58692,9 +58743,9 @@ function createTypeChecker(host) {
|
|
|
58692
58743
|
return prop ? getTypeOfSymbol(prop) : void 0;
|
|
58693
58744
|
}
|
|
58694
58745
|
function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
|
|
58695
|
-
var
|
|
58746
|
+
var _a2;
|
|
58696
58747
|
let propType;
|
|
58697
|
-
return getTypeOfPropertyOfType(type, name) || (propType = (
|
|
58748
|
+
return getTypeOfPropertyOfType(type, name) || (propType = (_a2 = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a2.type) && addOptionality(
|
|
58698
58749
|
propType,
|
|
58699
58750
|
/*isProperty*/
|
|
58700
58751
|
true,
|
|
@@ -59182,14 +59233,14 @@ function createTypeChecker(host) {
|
|
|
59182
59233
|
return widened;
|
|
59183
59234
|
}
|
|
59184
59235
|
function getJSContainerObjectType(decl, symbol, init) {
|
|
59185
|
-
var
|
|
59236
|
+
var _a2, _b;
|
|
59186
59237
|
if (!isInJSFile(decl) || !init || !isObjectLiteralExpression(init) || init.properties.length) {
|
|
59187
59238
|
return void 0;
|
|
59188
59239
|
}
|
|
59189
59240
|
const exports2 = createSymbolTable();
|
|
59190
59241
|
while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) {
|
|
59191
59242
|
const s2 = getSymbolOfNode(decl);
|
|
59192
|
-
if ((
|
|
59243
|
+
if ((_a2 = s2 == null ? void 0 : s2.exports) == null ? void 0 : _a2.size) {
|
|
59193
59244
|
mergeSymbolTable(exports2, s2.exports);
|
|
59194
59245
|
}
|
|
59195
59246
|
decl = isBinaryExpression(decl) ? decl.parent : decl.parent.parent;
|
|
@@ -59203,7 +59254,7 @@ function createTypeChecker(host) {
|
|
|
59203
59254
|
return type;
|
|
59204
59255
|
}
|
|
59205
59256
|
function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
|
|
59206
|
-
var
|
|
59257
|
+
var _a2;
|
|
59207
59258
|
const typeNode = getEffectiveTypeAnnotationNode(expression.parent);
|
|
59208
59259
|
if (typeNode) {
|
|
59209
59260
|
const type = getWidenedType(getTypeFromTypeNode(typeNode));
|
|
@@ -59219,7 +59270,7 @@ function createTypeChecker(host) {
|
|
|
59219
59270
|
);
|
|
59220
59271
|
}
|
|
59221
59272
|
}
|
|
59222
|
-
if ((
|
|
59273
|
+
if ((_a2 = symbol.parent) == null ? void 0 : _a2.valueDeclaration) {
|
|
59223
59274
|
const possiblyAnnotatedSymbol = getFunctionExpressionParentSymbolOrSymbol(symbol.parent);
|
|
59224
59275
|
if (possiblyAnnotatedSymbol.valueDeclaration) {
|
|
59225
59276
|
const typeNode2 = getEffectiveTypeAnnotationNode(possiblyAnnotatedSymbol.valueDeclaration);
|
|
@@ -59273,13 +59324,13 @@ function createTypeChecker(host) {
|
|
|
59273
59324
|
resolvedSymbol.exports = createSymbolTable();
|
|
59274
59325
|
}
|
|
59275
59326
|
(resolvedSymbol || symbol).exports.forEach((s, name) => {
|
|
59276
|
-
var
|
|
59327
|
+
var _a2;
|
|
59277
59328
|
const exportedMember = members.get(name);
|
|
59278
59329
|
if (exportedMember && exportedMember !== s && !(s.flags & 2097152 /* Alias */)) {
|
|
59279
59330
|
if (s.flags & 111551 /* Value */ && exportedMember.flags & 111551 /* Value */) {
|
|
59280
59331
|
if (s.valueDeclaration && exportedMember.valueDeclaration && getSourceFileOfNode(s.valueDeclaration) !== getSourceFileOfNode(exportedMember.valueDeclaration)) {
|
|
59281
59332
|
const unescapedName = unescapeLeadingUnderscores(s.escapedName);
|
|
59282
|
-
const exportedMemberName = ((
|
|
59333
|
+
const exportedMemberName = ((_a2 = tryCast(exportedMember.valueDeclaration, isNamedDeclaration)) == null ? void 0 : _a2.name) || exportedMember.valueDeclaration;
|
|
59283
59334
|
addRelatedInfo(
|
|
59284
59335
|
error2(s.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapedName),
|
|
59285
59336
|
createDiagnosticForNode(exportedMemberName, Diagnostics._0_was_also_declared_here, unescapedName)
|
|
@@ -59952,8 +60003,11 @@ function createTypeChecker(host) {
|
|
|
59952
60003
|
}
|
|
59953
60004
|
}
|
|
59954
60005
|
function getOuterTypeParametersOfClassOrInterface(symbol) {
|
|
59955
|
-
var
|
|
59956
|
-
|
|
60006
|
+
var _a2;
|
|
60007
|
+
if (getCheckFlags(symbol) & 2097152 /* SyntheticInterface */) {
|
|
60008
|
+
return void 0;
|
|
60009
|
+
}
|
|
60010
|
+
const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
|
|
59957
60011
|
if (decl.kind === 264 /* InterfaceDeclaration */) {
|
|
59958
60012
|
return true;
|
|
59959
60013
|
}
|
|
@@ -60274,13 +60328,13 @@ function createTypeChecker(host) {
|
|
|
60274
60328
|
return links.declaredType;
|
|
60275
60329
|
}
|
|
60276
60330
|
function getDeclaredTypeOfTypeAlias(symbol) {
|
|
60277
|
-
var
|
|
60331
|
+
var _a2;
|
|
60278
60332
|
const links = getSymbolLinks(symbol);
|
|
60279
60333
|
if (!links.declaredType) {
|
|
60280
60334
|
if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) {
|
|
60281
60335
|
return errorType;
|
|
60282
60336
|
}
|
|
60283
|
-
const declaration = Debug.checkDefined((
|
|
60337
|
+
const declaration = Debug.checkDefined((_a2 = symbol.declarations) == null ? void 0 : _a2.find(isTypeAlias), "Type alias symbol with no valid declaration found");
|
|
60284
60338
|
const typeNode = isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type;
|
|
60285
60339
|
let type = typeNode ? getTypeFromTypeNode(typeNode) : errorType;
|
|
60286
60340
|
if (popTypeResolution()) {
|
|
@@ -61179,8 +61233,8 @@ function createTypeChecker(host) {
|
|
|
61179
61233
|
if (symbol === globalThisSymbol) {
|
|
61180
61234
|
const varsOnly = /* @__PURE__ */ new Map();
|
|
61181
61235
|
members.forEach((p) => {
|
|
61182
|
-
var
|
|
61183
|
-
if (!(p.flags & 418 /* BlockScoped */) && !(p.flags & 512 /* ValueModule */ && ((
|
|
61236
|
+
var _a2;
|
|
61237
|
+
if (!(p.flags & 418 /* BlockScoped */) && !(p.flags & 512 /* ValueModule */ && ((_a2 = p.declarations) == null ? void 0 : _a2.length) && every(p.declarations, isAmbientModule))) {
|
|
61184
61238
|
varsOnly.set(p.escapedName, p);
|
|
61185
61239
|
}
|
|
61186
61240
|
});
|
|
@@ -61416,7 +61470,7 @@ function createTypeChecker(host) {
|
|
|
61416
61470
|
}
|
|
61417
61471
|
}
|
|
61418
61472
|
function getTypeOfMappedSymbol(symbol) {
|
|
61419
|
-
var
|
|
61473
|
+
var _a2;
|
|
61420
61474
|
if (!symbol.links.type) {
|
|
61421
61475
|
const mappedType = symbol.links.mappedType;
|
|
61422
61476
|
if (!pushTypeResolution(symbol, 0 /* Type */)) {
|
|
@@ -61435,7 +61489,7 @@ function createTypeChecker(host) {
|
|
|
61435
61489
|
error2(currentNode, Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType));
|
|
61436
61490
|
type = errorType;
|
|
61437
61491
|
}
|
|
61438
|
-
(
|
|
61492
|
+
(_a2 = symbol.links).type ?? (_a2.type = type);
|
|
61439
61493
|
}
|
|
61440
61494
|
return symbol.links.type;
|
|
61441
61495
|
}
|
|
@@ -61634,8 +61688,8 @@ function createTypeChecker(host) {
|
|
|
61634
61688
|
return !!typeVariable && isConstTypeVariable(typeVariable, depth);
|
|
61635
61689
|
}
|
|
61636
61690
|
function isConstTypeVariable(type, depth = 0) {
|
|
61637
|
-
var
|
|
61638
|
-
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((
|
|
61691
|
+
var _a2;
|
|
61692
|
+
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a2 = type.symbol) == null ? void 0 : _a2.declarations, (d) => hasSyntacticModifier(d, 4096 /* Const */)) || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isConstTypeVariable(t, depth)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType, depth + 1) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type), depth + 1) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType, depth) || getObjectFlags(type) & 32 /* Mapped */ && isConstMappedType(type, depth) || isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t, depth)) >= 0));
|
|
61639
61693
|
}
|
|
61640
61694
|
function getConstraintOfIndexedAccess(type) {
|
|
61641
61695
|
return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0;
|
|
@@ -61926,7 +61980,7 @@ function createTypeChecker(host) {
|
|
|
61926
61980
|
return getReducedType(getApparentType(getReducedType(type)));
|
|
61927
61981
|
}
|
|
61928
61982
|
function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) {
|
|
61929
|
-
var
|
|
61983
|
+
var _a2, _b, _c;
|
|
61930
61984
|
let singleProp;
|
|
61931
61985
|
let propSet;
|
|
61932
61986
|
let indexTypes;
|
|
@@ -61994,7 +62048,7 @@ function createTypeChecker(host) {
|
|
|
61994
62048
|
}
|
|
61995
62049
|
if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) {
|
|
61996
62050
|
if (mergedInstantiations) {
|
|
61997
|
-
const links = (
|
|
62051
|
+
const links = (_a2 = tryCast(singleProp, isTransientSymbol)) == null ? void 0 : _a2.links;
|
|
61998
62052
|
const clone2 = createSymbolWithType(singleProp, links == null ? void 0 : links.type);
|
|
61999
62053
|
clone2.parent = (_c = (_b = singleProp.valueDeclaration) == null ? void 0 : _b.symbol) == null ? void 0 : _c.parent;
|
|
62000
62054
|
clone2.links.containingType = containingType;
|
|
@@ -62065,8 +62119,8 @@ function createTypeChecker(host) {
|
|
|
62065
62119
|
return result;
|
|
62066
62120
|
}
|
|
62067
62121
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
62068
|
-
var
|
|
62069
|
-
let property = skipObjectFunctionPropertyAugment ? (
|
|
62122
|
+
var _a2, _b, _c;
|
|
62123
|
+
let property = skipObjectFunctionPropertyAugment ? (_a2 = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a2.get(name) : (_b = type.propertyCache) == null ? void 0 : _b.get(name);
|
|
62070
62124
|
if (!property) {
|
|
62071
62125
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
62072
62126
|
if (property) {
|
|
@@ -62167,12 +62221,12 @@ function createTypeChecker(host) {
|
|
|
62167
62221
|
return errorInfo;
|
|
62168
62222
|
}
|
|
62169
62223
|
function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) {
|
|
62170
|
-
var
|
|
62224
|
+
var _a2, _b;
|
|
62171
62225
|
type = getReducedApparentType(type);
|
|
62172
62226
|
if (type.flags & 524288 /* Object */) {
|
|
62173
62227
|
const resolved = resolveStructuredTypeMembers(type);
|
|
62174
62228
|
const symbol = resolved.members.get(name);
|
|
62175
|
-
if (symbol && !includeTypeOnlyMembers && ((
|
|
62229
|
+
if (symbol && !includeTypeOnlyMembers && ((_a2 = type.symbol) == null ? void 0 : _a2.flags) & 512 /* ValueModule */ && ((_b = getSymbolLinks(type.symbol).typeOnlyExportStarMap) == null ? void 0 : _b.has(name))) {
|
|
62176
62230
|
return void 0;
|
|
62177
62231
|
}
|
|
62178
62232
|
if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) {
|
|
@@ -62224,8 +62278,8 @@ function createTypeChecker(host) {
|
|
|
62224
62278
|
}
|
|
62225
62279
|
let memberName;
|
|
62226
62280
|
if (everyType(type, (t) => {
|
|
62227
|
-
var
|
|
62228
|
-
return !!((
|
|
62281
|
+
var _a2;
|
|
62282
|
+
return !!((_a2 = t.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
|
|
62229
62283
|
})) {
|
|
62230
62284
|
const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
|
|
62231
62285
|
const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
|
|
@@ -62289,8 +62343,8 @@ function createTypeChecker(host) {
|
|
|
62289
62343
|
return findIndexInfo(getIndexInfosOfType(type), keyType);
|
|
62290
62344
|
}
|
|
62291
62345
|
function getIndexTypeOfType(type, keyType) {
|
|
62292
|
-
var
|
|
62293
|
-
return (
|
|
62346
|
+
var _a2;
|
|
62347
|
+
return (_a2 = getIndexInfoOfType(type, keyType)) == null ? void 0 : _a2.type;
|
|
62294
62348
|
}
|
|
62295
62349
|
function getApplicableIndexInfos(type, keyType) {
|
|
62296
62350
|
return getIndexInfosOfType(type).filter((info) => isApplicableIndexType(keyType, info.keyType));
|
|
@@ -62302,12 +62356,12 @@ function createTypeChecker(host) {
|
|
|
62302
62356
|
return getApplicableIndexInfo(type, isLateBoundName(name) ? esSymbolType : getStringLiteralType(unescapeLeadingUnderscores(name)));
|
|
62303
62357
|
}
|
|
62304
62358
|
function getTypeParametersFromDeclaration(declaration) {
|
|
62305
|
-
var
|
|
62359
|
+
var _a2;
|
|
62306
62360
|
let result;
|
|
62307
62361
|
for (const node of getEffectiveTypeParameterDeclarations(declaration)) {
|
|
62308
62362
|
result = appendIfUnique(result, getDeclaredTypeOfTypeParameter(node.symbol));
|
|
62309
62363
|
}
|
|
62310
|
-
return (result == null ? void 0 : result.length) ? result : isFunctionDeclaration(declaration) ? (
|
|
62364
|
+
return (result == null ? void 0 : result.length) ? result : isFunctionDeclaration(declaration) ? (_a2 = getSignatureOfTypeTag(declaration)) == null ? void 0 : _a2.typeParameters : void 0;
|
|
62311
62365
|
}
|
|
62312
62366
|
function symbolsToArray(symbols) {
|
|
62313
62367
|
const result = [];
|
|
@@ -62794,9 +62848,9 @@ function createTypeChecker(host) {
|
|
|
62794
62848
|
return signature;
|
|
62795
62849
|
}
|
|
62796
62850
|
function getOrCreateTypeFromSignature(signature, outerTypeParameters) {
|
|
62797
|
-
var
|
|
62851
|
+
var _a2;
|
|
62798
62852
|
if (!signature.isolatedSignatureType) {
|
|
62799
|
-
const kind = (
|
|
62853
|
+
const kind = (_a2 = signature.declaration) == null ? void 0 : _a2.kind;
|
|
62800
62854
|
const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
|
|
62801
62855
|
const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, createSymbol(16 /* Function */, "__function" /* Function */));
|
|
62802
62856
|
if (signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
@@ -62857,9 +62911,9 @@ function createTypeChecker(host) {
|
|
|
62857
62911
|
return mapDefined(filter(type.symbol && type.symbol.declarations, isTypeParameterDeclaration), getEffectiveConstraintOfTypeParameter)[0];
|
|
62858
62912
|
}
|
|
62859
62913
|
function getInferredTypeParameterConstraint(typeParameter, omitTypeReferences) {
|
|
62860
|
-
var
|
|
62914
|
+
var _a2;
|
|
62861
62915
|
let inferences;
|
|
62862
|
-
if ((
|
|
62916
|
+
if ((_a2 = typeParameter.symbol) == null ? void 0 : _a2.declarations) {
|
|
62863
62917
|
for (const declaration of typeParameter.symbol.declarations) {
|
|
62864
62918
|
if (declaration.parent.kind === 195 /* InferType */) {
|
|
62865
62919
|
const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent);
|
|
@@ -63000,10 +63054,10 @@ function createTypeChecker(host) {
|
|
|
63000
63054
|
return type;
|
|
63001
63055
|
}
|
|
63002
63056
|
function getTypeArguments(type) {
|
|
63003
|
-
var
|
|
63057
|
+
var _a2, _b;
|
|
63004
63058
|
if (!type.resolvedTypeArguments) {
|
|
63005
63059
|
if (!pushTypeResolution(type, 6 /* ResolvedTypeArguments */)) {
|
|
63006
|
-
return ((
|
|
63060
|
+
return ((_a2 = type.target.localTypeParameters) == null ? void 0 : _a2.map(() => errorType)) || emptyArray;
|
|
63007
63061
|
}
|
|
63008
63062
|
const node = type.node;
|
|
63009
63063
|
const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
|
|
@@ -63134,8 +63188,8 @@ function createTypeChecker(host) {
|
|
|
63134
63188
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
63135
63189
|
}
|
|
63136
63190
|
function isLocalTypeAlias(symbol) {
|
|
63137
|
-
var
|
|
63138
|
-
const declaration = (
|
|
63191
|
+
var _a2;
|
|
63192
|
+
const declaration = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isTypeAlias);
|
|
63139
63193
|
return !!(declaration && getContainingFunction(declaration));
|
|
63140
63194
|
}
|
|
63141
63195
|
function getTypeReferenceName(node) {
|
|
@@ -63972,7 +64026,7 @@ function createTypeChecker(host) {
|
|
|
63972
64026
|
return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
|
|
63973
64027
|
}
|
|
63974
64028
|
function createNormalizedTupleType(target, elementTypes) {
|
|
63975
|
-
var
|
|
64029
|
+
var _a2, _b, _c, _d;
|
|
63976
64030
|
if (!(target.combinedFlags & 14 /* NonRequired */)) {
|
|
63977
64031
|
return createTypeReference(target, elementTypes);
|
|
63978
64032
|
}
|
|
@@ -63993,7 +64047,7 @@ function createTypeChecker(host) {
|
|
|
63993
64047
|
const flags = target.elementFlags[i];
|
|
63994
64048
|
if (flags & 8 /* Variadic */) {
|
|
63995
64049
|
if (type.flags & 1 /* Any */) {
|
|
63996
|
-
addElement(type, 4 /* Rest */, (
|
|
64050
|
+
addElement(type, 4 /* Rest */, (_a2 = target.labeledElementDeclarations) == null ? void 0 : _a2[i]);
|
|
63997
64051
|
} else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
|
|
63998
64052
|
addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
|
|
63999
64053
|
} else if (isTupleType(type)) {
|
|
@@ -64006,8 +64060,8 @@ function createTypeChecker(host) {
|
|
|
64006
64060
|
return errorType;
|
|
64007
64061
|
}
|
|
64008
64062
|
forEach(elements, (t, n) => {
|
|
64009
|
-
var
|
|
64010
|
-
return addElement(t, type.target.elementFlags[n], (
|
|
64063
|
+
var _a3;
|
|
64064
|
+
return addElement(t, type.target.elementFlags[n], (_a3 = type.target.labeledElementDeclarations) == null ? void 0 : _a3[n]);
|
|
64011
64065
|
});
|
|
64012
64066
|
} else {
|
|
64013
64067
|
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
|
|
@@ -64131,7 +64185,7 @@ function createTypeChecker(host) {
|
|
|
64131
64185
|
return includes;
|
|
64132
64186
|
}
|
|
64133
64187
|
function removeSubtypes(types, hasObjectTypes) {
|
|
64134
|
-
var
|
|
64188
|
+
var _a2;
|
|
64135
64189
|
if (types.length < 2) {
|
|
64136
64190
|
return types;
|
|
64137
64191
|
}
|
|
@@ -64161,7 +64215,7 @@ function createTypeChecker(host) {
|
|
|
64161
64215
|
if (count === 1e5) {
|
|
64162
64216
|
const estimatedCount = count / (len - i) * len;
|
|
64163
64217
|
if (estimatedCount > 1e6) {
|
|
64164
|
-
(
|
|
64218
|
+
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "removeSubtypes_DepthLimit", { typeIds: types.map((t) => t.id) });
|
|
64165
64219
|
error2(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);
|
|
64166
64220
|
return void 0;
|
|
64167
64221
|
}
|
|
@@ -64626,10 +64680,10 @@ function createTypeChecker(host) {
|
|
|
64626
64680
|
return reduceLeft(types, (n, t) => t.flags & 1048576 /* Union */ ? n * t.types.length : t.flags & 131072 /* Never */ ? 0 : n, 1);
|
|
64627
64681
|
}
|
|
64628
64682
|
function checkCrossProductUnion(types) {
|
|
64629
|
-
var
|
|
64683
|
+
var _a2;
|
|
64630
64684
|
const size = getCrossProductUnionSize(types);
|
|
64631
64685
|
if (size >= 1e5) {
|
|
64632
|
-
(
|
|
64686
|
+
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "checkCrossProductUnion_DepthLimit", { typeIds: types.map((t) => t.id), size });
|
|
64633
64687
|
error2(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);
|
|
64634
64688
|
return false;
|
|
64635
64689
|
}
|
|
@@ -64817,7 +64871,7 @@ function createTypeChecker(host) {
|
|
|
64817
64871
|
return links.resolvedType;
|
|
64818
64872
|
}
|
|
64819
64873
|
function getTemplateLiteralType(texts, types) {
|
|
64820
|
-
var
|
|
64874
|
+
var _a2, _b;
|
|
64821
64875
|
const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)));
|
|
64822
64876
|
if (unionIndex >= 0) {
|
|
64823
64877
|
return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType;
|
|
@@ -64825,7 +64879,7 @@ function createTypeChecker(host) {
|
|
|
64825
64879
|
if (contains(types, wildcardType)) {
|
|
64826
64880
|
return wildcardType;
|
|
64827
64881
|
}
|
|
64828
|
-
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (
|
|
64882
|
+
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (_a2 = types[0].symbol) == null ? void 0 : _a2.declarations) == null ? void 0 : _b.some((d) => d.parent.kind === 195 /* InferType */)) && isTypeAssignableTo(types[0], stringType)) {
|
|
64829
64883
|
return types[0];
|
|
64830
64884
|
}
|
|
64831
64885
|
const newTypes = [];
|
|
@@ -65329,7 +65383,7 @@ function createTypeChecker(host) {
|
|
|
65329
65383
|
if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
|
|
65330
65384
|
indexType = stringType;
|
|
65331
65385
|
}
|
|
65332
|
-
if (
|
|
65386
|
+
if (noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
65333
65387
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
65334
65388
|
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target)) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target))) || isGenericReducibleType(objectType))) {
|
|
65335
65389
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
@@ -65577,7 +65631,7 @@ function createTypeChecker(host) {
|
|
|
65577
65631
|
}
|
|
65578
65632
|
}
|
|
65579
65633
|
function getTypeFromImportTypeNode(node) {
|
|
65580
|
-
var
|
|
65634
|
+
var _a2;
|
|
65581
65635
|
const links = getNodeLinks(node);
|
|
65582
65636
|
if (!links.resolvedType) {
|
|
65583
65637
|
if (!isLiteralImportTypeNode(node)) {
|
|
@@ -65591,7 +65645,7 @@ function createTypeChecker(host) {
|
|
|
65591
65645
|
links.resolvedSymbol = unknownSymbol;
|
|
65592
65646
|
return links.resolvedType = errorType;
|
|
65593
65647
|
}
|
|
65594
|
-
const isExportEquals = !!((
|
|
65648
|
+
const isExportEquals = !!((_a2 = innerModuleSymbol.exports) == null ? void 0 : _a2.get("export=" /* ExportEquals */));
|
|
65595
65649
|
const moduleSymbol = resolveExternalModuleSymbol(
|
|
65596
65650
|
innerModuleSymbol,
|
|
65597
65651
|
/*dontResolveAlias*/
|
|
@@ -65796,8 +65850,8 @@ function createTypeChecker(host) {
|
|
|
65796
65850
|
return spread;
|
|
65797
65851
|
}
|
|
65798
65852
|
function isSpreadableProperty(prop) {
|
|
65799
|
-
var
|
|
65800
|
-
return !some(prop.declarations, isPrivateIdentifierClassElementDeclaration) && (!(prop.flags & (8192 /* Method */ | 32768 /* GetAccessor */ | 65536 /* SetAccessor */)) || !((
|
|
65853
|
+
var _a2;
|
|
65854
|
+
return !some(prop.declarations, isPrivateIdentifierClassElementDeclaration) && (!(prop.flags & (8192 /* Method */ | 32768 /* GetAccessor */ | 65536 /* SetAccessor */)) || !((_a2 = prop.declarations) == null ? void 0 : _a2.some((decl) => isClassLike(decl.parent))));
|
|
65801
65855
|
}
|
|
65802
65856
|
function getSpreadSymbol(prop, readonly) {
|
|
65803
65857
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
@@ -66439,12 +66493,12 @@ function createTypeChecker(host) {
|
|
|
66439
66493
|
) : type;
|
|
66440
66494
|
}
|
|
66441
66495
|
function instantiateTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
66442
|
-
var
|
|
66496
|
+
var _a2;
|
|
66443
66497
|
if (!couldContainTypeVariables(type)) {
|
|
66444
66498
|
return type;
|
|
66445
66499
|
}
|
|
66446
66500
|
if (instantiationDepth === 100 || instantiationCount >= 5e6) {
|
|
66447
|
-
(
|
|
66501
|
+
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth, instantiationCount });
|
|
66448
66502
|
error2(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
66449
66503
|
return errorType;
|
|
66450
66504
|
}
|
|
@@ -67618,7 +67672,7 @@ function createTypeChecker(host) {
|
|
|
67618
67672
|
return elements !== normalizedElements ? createNormalizedTupleType(type.target, normalizedElements) : type;
|
|
67619
67673
|
}
|
|
67620
67674
|
function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) {
|
|
67621
|
-
var
|
|
67675
|
+
var _a2;
|
|
67622
67676
|
let errorInfo;
|
|
67623
67677
|
let relatedInfo;
|
|
67624
67678
|
let maybeKeys;
|
|
@@ -67658,7 +67712,7 @@ function createTypeChecker(host) {
|
|
|
67658
67712
|
false
|
|
67659
67713
|
);
|
|
67660
67714
|
relation.set(id, 4 /* Reported */ | 2 /* Failed */);
|
|
67661
|
-
(
|
|
67715
|
+
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth });
|
|
67662
67716
|
const message = relationCount <= 0 ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1;
|
|
67663
67717
|
const diag2 = error2(errorNode || currentNode, message, typeToString(source), typeToString(target));
|
|
67664
67718
|
if (errorOutputContainer) {
|
|
@@ -68033,7 +68087,7 @@ function createTypeChecker(host) {
|
|
|
68033
68087
|
return 0 /* False */;
|
|
68034
68088
|
}
|
|
68035
68089
|
function reportErrorResults(originalSource, originalTarget, source2, target2, headMessage2) {
|
|
68036
|
-
var
|
|
68090
|
+
var _a3, _b;
|
|
68037
68091
|
const sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
68038
68092
|
const targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
68039
68093
|
source2 = originalSource.aliasSymbol || sourceHasBase ? originalSource : source2;
|
|
@@ -68083,7 +68137,7 @@ function createTypeChecker(host) {
|
|
|
68083
68137
|
return;
|
|
68084
68138
|
}
|
|
68085
68139
|
reportRelationError(headMessage2, source2, target2);
|
|
68086
|
-
if (source2.flags & 262144 /* TypeParameter */ && ((_b = (
|
|
68140
|
+
if (source2.flags & 262144 /* TypeParameter */ && ((_b = (_a3 = source2.symbol) == null ? void 0 : _a3.declarations) == null ? void 0 : _b[0]) && !getConstraintOfType(source2)) {
|
|
68087
68141
|
const syntheticParam = cloneTypeParameter(source2);
|
|
68088
68142
|
syntheticParam.constraint = instantiateType(target2, makeUnaryTypeMapper(source2, syntheticParam));
|
|
68089
68143
|
if (hasNonCircularBaseConstraint(syntheticParam)) {
|
|
@@ -68118,10 +68172,10 @@ function createTypeChecker(host) {
|
|
|
68118
68172
|
}
|
|
68119
68173
|
function getTypeOfPropertyInTypes(types, name) {
|
|
68120
68174
|
const appendPropType = (propTypes, type) => {
|
|
68121
|
-
var
|
|
68175
|
+
var _a3;
|
|
68122
68176
|
type = getApparentType(type);
|
|
68123
68177
|
const prop = type.flags & 3145728 /* UnionOrIntersection */ ? getPropertyOfUnionOrIntersectionType(type, name) : getPropertyOfObjectType(type, name);
|
|
68124
|
-
const propType = prop && getTypeOfSymbol(prop) || ((
|
|
68178
|
+
const propType = prop && getTypeOfSymbol(prop) || ((_a3 = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a3.type) || undefinedType;
|
|
68125
68179
|
return append(propTypes, propType);
|
|
68126
68180
|
};
|
|
68127
68181
|
return getUnionType(reduceLeft(
|
|
@@ -68132,7 +68186,7 @@ function createTypeChecker(host) {
|
|
|
68132
68186
|
) || emptyArray);
|
|
68133
68187
|
}
|
|
68134
68188
|
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
68135
|
-
var
|
|
68189
|
+
var _a3;
|
|
68136
68190
|
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 4096 /* JSLiteral */) {
|
|
68137
68191
|
return false;
|
|
68138
68192
|
}
|
|
@@ -68166,7 +68220,7 @@ function createTypeChecker(host) {
|
|
|
68166
68220
|
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));
|
|
68167
68221
|
}
|
|
68168
68222
|
} else {
|
|
68169
|
-
const objectLiteralDeclaration = ((
|
|
68223
|
+
const objectLiteralDeclaration = ((_a3 = source2.symbol) == null ? void 0 : _a3.declarations) && firstOrUndefined(source2.symbol.declarations);
|
|
68170
68224
|
let suggestion;
|
|
68171
68225
|
if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, (d) => d === objectLiteralDeclaration) && getSourceFileOfNode(objectLiteralDeclaration) === getSourceFileOfNode(errorNode)) {
|
|
68172
68226
|
const propDeclaration = prop.valueDeclaration;
|
|
@@ -68506,7 +68560,7 @@ function createTypeChecker(host) {
|
|
|
68506
68560
|
return result2;
|
|
68507
68561
|
}
|
|
68508
68562
|
function recursiveTypeRelatedTo(source2, target2, reportErrors2, intersectionState, recursionFlags) {
|
|
68509
|
-
var
|
|
68563
|
+
var _a3, _b, _c;
|
|
68510
68564
|
if (overflow) {
|
|
68511
68565
|
return 0 /* False */;
|
|
68512
68566
|
}
|
|
@@ -68591,7 +68645,7 @@ function createTypeChecker(host) {
|
|
|
68591
68645
|
}
|
|
68592
68646
|
let result2;
|
|
68593
68647
|
if (expandingFlags === 3 /* Both */) {
|
|
68594
|
-
(
|
|
68648
|
+
(_a3 = tracing) == null ? void 0 : _a3.instant(tracing.Phase.CheckTypes, "recursiveTypeRelatedTo_DepthLimit", {
|
|
68595
68649
|
sourceId: source2.id,
|
|
68596
68650
|
sourceIdStack: sourceStack.map((t) => t.id),
|
|
68597
68651
|
targetId: target2.id,
|
|
@@ -69272,7 +69326,7 @@ function createTypeChecker(host) {
|
|
|
69272
69326
|
return 0 /* False */;
|
|
69273
69327
|
}
|
|
69274
69328
|
function typeRelatedToDiscriminatedType(source2, target2) {
|
|
69275
|
-
var
|
|
69329
|
+
var _a3;
|
|
69276
69330
|
const sourceProperties = getPropertiesOfType(source2);
|
|
69277
69331
|
const sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target2);
|
|
69278
69332
|
if (!sourcePropertiesFiltered)
|
|
@@ -69281,7 +69335,7 @@ function createTypeChecker(host) {
|
|
|
69281
69335
|
for (const sourceProperty of sourcePropertiesFiltered) {
|
|
69282
69336
|
numCombinations *= countTypes(getNonMissingTypeOfSymbol(sourceProperty));
|
|
69283
69337
|
if (numCombinations > 25) {
|
|
69284
|
-
(
|
|
69338
|
+
(_a3 = tracing) == null ? void 0 : _a3.instant(tracing.Phase.CheckTypes, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source2.id, targetId: target2.id, numCombinations });
|
|
69285
69339
|
return 0 /* False */;
|
|
69286
69340
|
}
|
|
69287
69341
|
}
|
|
@@ -69688,7 +69742,7 @@ function createTypeChecker(host) {
|
|
|
69688
69742
|
return result2;
|
|
69689
69743
|
}
|
|
69690
69744
|
function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) {
|
|
69691
|
-
var
|
|
69745
|
+
var _a3, _b;
|
|
69692
69746
|
if (relation === identityRelation) {
|
|
69693
69747
|
return signaturesIdenticalTo(source2, target2, kind);
|
|
69694
69748
|
}
|
|
@@ -69744,7 +69798,7 @@ function createTypeChecker(host) {
|
|
|
69744
69798
|
const sourceSignature = first(sourceSignatures);
|
|
69745
69799
|
const targetSignature = first(targetSignatures);
|
|
69746
69800
|
result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature));
|
|
69747
|
-
if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((
|
|
69801
|
+
if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a3 = targetSignature.declaration) == null ? void 0 : _a3.kind) === 176 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176 /* Constructor */)) {
|
|
69748
69802
|
const constructSignatureToString = (signature) => signatureToString(
|
|
69749
69803
|
signature,
|
|
69750
69804
|
/*enclosingDeclaration*/
|
|
@@ -70062,10 +70116,10 @@ function createTypeChecker(host) {
|
|
|
70062
70116
|
return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters);
|
|
70063
70117
|
}
|
|
70064
70118
|
function getVariancesWorker(symbol, typeParameters = emptyArray) {
|
|
70065
|
-
var
|
|
70119
|
+
var _a2, _b;
|
|
70066
70120
|
const links = getSymbolLinks(symbol);
|
|
70067
70121
|
if (!links.variances) {
|
|
70068
|
-
(
|
|
70122
|
+
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.CheckTypes, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
70069
70123
|
const oldVarianceComputation = inVarianceComputation;
|
|
70070
70124
|
const saveResolutionStart = resolutionStart;
|
|
70071
70125
|
if (!inVarianceComputation) {
|
|
@@ -70123,8 +70177,8 @@ function createTypeChecker(host) {
|
|
|
70123
70177
|
return markerTypes.has(getTypeId(type));
|
|
70124
70178
|
}
|
|
70125
70179
|
function getTypeParameterModifiers(tp) {
|
|
70126
|
-
var
|
|
70127
|
-
return reduceLeft((
|
|
70180
|
+
var _a2;
|
|
70181
|
+
return reduceLeft((_a2 = tp.symbol) == null ? void 0 : _a2.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (8192 /* In */ | 16384 /* Out */ | 4096 /* Const */);
|
|
70128
70182
|
}
|
|
70129
70183
|
function hasCovariantVoidArgument(typeArguments, variances) {
|
|
70130
70184
|
for (let i = 0; i < variances.length; i++) {
|
|
@@ -70182,7 +70236,7 @@ function createTypeChecker(host) {
|
|
|
70182
70236
|
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : `${source.id},${target.id}${postFix}`;
|
|
70183
70237
|
}
|
|
70184
70238
|
function forEachProperty2(prop, callback) {
|
|
70185
|
-
if (getCheckFlags(prop) & 6 /*
|
|
70239
|
+
if (getCheckFlags(prop) & 6 /* SyntheticMember */) {
|
|
70186
70240
|
for (const t of prop.links.containingType.types) {
|
|
70187
70241
|
const p = getPropertyOfType(t, prop.escapedName);
|
|
70188
70242
|
const result = p && forEachProperty2(p, callback);
|
|
@@ -70480,7 +70534,7 @@ function createTypeChecker(host) {
|
|
|
70480
70534
|
return propType;
|
|
70481
70535
|
}
|
|
70482
70536
|
if (everyType(type, isTupleType)) {
|
|
70483
|
-
return getTupleElementTypeOutOfStartCount(type, index,
|
|
70537
|
+
return getTupleElementTypeOutOfStartCount(type, index, noUncheckedIndexedAccess ? undefinedType : void 0);
|
|
70484
70538
|
}
|
|
70485
70539
|
return void 0;
|
|
70486
70540
|
}
|
|
@@ -71799,7 +71853,7 @@ function createTypeChecker(host) {
|
|
|
71799
71853
|
inferFromTypes(sourceNameType, targetNameType);
|
|
71800
71854
|
}
|
|
71801
71855
|
function inferFromObjectTypes(source, target) {
|
|
71802
|
-
var
|
|
71856
|
+
var _a2, _b;
|
|
71803
71857
|
if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
|
|
71804
71858
|
inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target));
|
|
71805
71859
|
return;
|
|
@@ -71846,7 +71900,7 @@ function createTypeChecker(host) {
|
|
|
71846
71900
|
inferFromTypes(sliceTupleType(source, startLength + targetInfo.impliedArity, endLength), elementTypes[startLength + 1]);
|
|
71847
71901
|
}
|
|
71848
71902
|
} else if (elementFlags[startLength] & 8 /* Variadic */ && elementFlags[startLength + 1] & 4 /* Rest */) {
|
|
71849
|
-
const param = (
|
|
71903
|
+
const param = (_a2 = getInferenceInfoForType(elementTypes[startLength])) == null ? void 0 : _a2.typeParameter;
|
|
71850
71904
|
const constraint = param && getBaseConstraintOfType(param);
|
|
71851
71905
|
if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) {
|
|
71852
71906
|
const impliedArity = constraint.target.fixedLength;
|
|
@@ -72333,8 +72387,8 @@ function createTypeChecker(host) {
|
|
|
72333
72387
|
return unionType.keyPropertyName.length ? unionType.keyPropertyName : void 0;
|
|
72334
72388
|
}
|
|
72335
72389
|
function getConstituentTypeForKeyType(unionType, keyType) {
|
|
72336
|
-
var
|
|
72337
|
-
const result = (
|
|
72390
|
+
var _a2;
|
|
72391
|
+
const result = (_a2 = unionType.constituentMap) == null ? void 0 : _a2.get(getTypeId(getRegularTypeOfLiteralType(keyType)));
|
|
72338
72392
|
return result !== unknownType ? result : void 0;
|
|
72339
72393
|
}
|
|
72340
72394
|
function getMatchingUnionConstituentForType(unionType, type) {
|
|
@@ -72518,12 +72572,12 @@ function createTypeChecker(host) {
|
|
|
72518
72572
|
return defaultExpression ? getUnionType([getNonUndefinedType(type), getTypeOfExpression(defaultExpression)]) : type;
|
|
72519
72573
|
}
|
|
72520
72574
|
function getTypeOfDestructuredProperty(type, name) {
|
|
72521
|
-
var
|
|
72575
|
+
var _a2;
|
|
72522
72576
|
const nameType = getLiteralTypeFromPropertyName(name);
|
|
72523
72577
|
if (!isTypeUsableAsPropertyName(nameType))
|
|
72524
72578
|
return errorType;
|
|
72525
72579
|
const text = getPropertyNameFromType(nameType);
|
|
72526
|
-
return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((
|
|
72580
|
+
return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((_a2 = getApplicableIndexInfoForName(type, text)) == null ? void 0 : _a2.type) || errorType;
|
|
72527
72581
|
}
|
|
72528
72582
|
function getTypeOfDestructuredArrayElement(type, index) {
|
|
72529
72583
|
return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(
|
|
@@ -72537,7 +72591,7 @@ function createTypeChecker(host) {
|
|
|
72537
72591
|
function includeUndefinedInIndexSignature(type) {
|
|
72538
72592
|
if (!type)
|
|
72539
72593
|
return type;
|
|
72540
|
-
return
|
|
72594
|
+
return noUncheckedIndexedAccess ? getUnionType([type, missingType]) : type;
|
|
72541
72595
|
}
|
|
72542
72596
|
function getTypeOfDestructuredSpreadExpression(type) {
|
|
72543
72597
|
return createArrayType(checkIteratedTypeOrElementType(
|
|
@@ -73100,7 +73154,7 @@ function createTypeChecker(host) {
|
|
|
73100
73154
|
}
|
|
73101
73155
|
return false;
|
|
73102
73156
|
}
|
|
73103
|
-
function getFlowTypeOfReference(reference, declaredType, initialType = declaredType, flowContainer, flowNode = ((
|
|
73157
|
+
function getFlowTypeOfReference(reference, declaredType, initialType = declaredType, flowContainer, flowNode = ((_b) => (_b = tryCast(reference, canHaveFlowNode)) == null ? void 0 : _b.flowNode)()) {
|
|
73104
73158
|
let key;
|
|
73105
73159
|
let isKeySet = false;
|
|
73106
73160
|
let flowDepth = 0;
|
|
@@ -73835,7 +73889,7 @@ function createTypeChecker(host) {
|
|
|
73835
73889
|
if (!hasDefaultClause) {
|
|
73836
73890
|
return caseType;
|
|
73837
73891
|
}
|
|
73838
|
-
const defaultType = filterType(type, (t) => !(isUnitLikeType(t) && contains(switchTypes, getRegularTypeOfLiteralType(extractUnitType(t)))));
|
|
73892
|
+
const defaultType = filterType(type, (t) => !(isUnitLikeType(t) && contains(switchTypes, t.flags & 32768 /* Undefined */ ? undefinedType : getRegularTypeOfLiteralType(extractUnitType(t)))));
|
|
73839
73893
|
return caseType.flags & 131072 /* Never */ ? defaultType : getUnionType([caseType, defaultType]);
|
|
73840
73894
|
}
|
|
73841
73895
|
function narrowTypeByTypeName(type, typeName) {
|
|
@@ -74362,7 +74416,7 @@ function createTypeChecker(host) {
|
|
|
74362
74416
|
}
|
|
74363
74417
|
}
|
|
74364
74418
|
function getNarrowedTypeOfSymbol(symbol, location, checkMode) {
|
|
74365
|
-
var
|
|
74419
|
+
var _a2;
|
|
74366
74420
|
const type = getTypeOfSymbol(symbol, checkMode);
|
|
74367
74421
|
const declaration = symbol.valueDeclaration;
|
|
74368
74422
|
if (declaration) {
|
|
@@ -74404,7 +74458,7 @@ function createTypeChecker(host) {
|
|
|
74404
74458
|
if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
|
|
74405
74459
|
const contextualSignature = getContextualSignature(func);
|
|
74406
74460
|
if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
|
|
74407
|
-
const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (
|
|
74461
|
+
const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a2 = getInferenceContext(func)) == null ? void 0 : _a2.nonFixingMapper));
|
|
74408
74462
|
if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !some(func.parameters, isSomeSymbolAssigned)) {
|
|
74409
74463
|
const narrowedType = getFlowTypeOfReference(
|
|
74410
74464
|
func,
|
|
@@ -74556,7 +74610,7 @@ function createTypeChecker(host) {
|
|
|
74556
74610
|
}
|
|
74557
74611
|
}
|
|
74558
74612
|
function shouldMarkIdentifierAliasReferenced(node) {
|
|
74559
|
-
var
|
|
74613
|
+
var _a2;
|
|
74560
74614
|
const parent2 = node.parent;
|
|
74561
74615
|
if (parent2) {
|
|
74562
74616
|
if (isPropertyAccessExpression(parent2) && parent2.expression === node) {
|
|
@@ -74565,7 +74619,7 @@ function createTypeChecker(host) {
|
|
|
74565
74619
|
if (isExportSpecifier(parent2) && parent2.isTypeOnly) {
|
|
74566
74620
|
return false;
|
|
74567
74621
|
}
|
|
74568
|
-
const greatGrandparent = (
|
|
74622
|
+
const greatGrandparent = (_a2 = parent2.parent) == null ? void 0 : _a2.parent;
|
|
74569
74623
|
if (greatGrandparent && isExportDeclaration(greatGrandparent) && greatGrandparent.isTypeOnly) {
|
|
74570
74624
|
return false;
|
|
74571
74625
|
}
|
|
@@ -75297,7 +75351,7 @@ function createTypeChecker(host) {
|
|
|
75297
75351
|
}
|
|
75298
75352
|
}
|
|
75299
75353
|
function getContextualTypeForAssignmentDeclaration(binaryExpression) {
|
|
75300
|
-
var
|
|
75354
|
+
var _a2, _b;
|
|
75301
75355
|
const kind = getAssignmentDeclarationKind(binaryExpression);
|
|
75302
75356
|
switch (kind) {
|
|
75303
75357
|
case 0 /* None */:
|
|
@@ -75356,7 +75410,7 @@ function createTypeChecker(host) {
|
|
|
75356
75410
|
case 2 /* ModuleExports */:
|
|
75357
75411
|
let valueDeclaration;
|
|
75358
75412
|
if (kind !== 2 /* ModuleExports */) {
|
|
75359
|
-
valueDeclaration = canHaveSymbol(binaryExpression.left) ? (
|
|
75413
|
+
valueDeclaration = canHaveSymbol(binaryExpression.left) ? (_a2 = binaryExpression.left.symbol) == null ? void 0 : _a2.valueDeclaration : void 0;
|
|
75360
75414
|
}
|
|
75361
75415
|
valueDeclaration || (valueDeclaration = (_b = binaryExpression.symbol) == null ? void 0 : _b.valueDeclaration);
|
|
75362
75416
|
const annotated = valueDeclaration && getEffectiveTypeAnnotationNode(valueDeclaration);
|
|
@@ -75423,7 +75477,7 @@ function createTypeChecker(host) {
|
|
|
75423
75477
|
return mapType(
|
|
75424
75478
|
type,
|
|
75425
75479
|
(t) => {
|
|
75426
|
-
var
|
|
75480
|
+
var _a2;
|
|
75427
75481
|
if (isGenericMappedType(t) && !t.declaration.nameType) {
|
|
75428
75482
|
const constraint = getConstraintTypeFromMappedType(t);
|
|
75429
75483
|
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
@@ -75451,7 +75505,7 @@ function createTypeChecker(host) {
|
|
|
75451
75505
|
return restType;
|
|
75452
75506
|
}
|
|
75453
75507
|
}
|
|
75454
|
-
return (
|
|
75508
|
+
return (_a2 = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a2.type;
|
|
75455
75509
|
}
|
|
75456
75510
|
return void 0;
|
|
75457
75511
|
},
|
|
@@ -75493,8 +75547,8 @@ function createTypeChecker(host) {
|
|
|
75493
75547
|
return mapType(
|
|
75494
75548
|
type,
|
|
75495
75549
|
(t) => {
|
|
75496
|
-
var
|
|
75497
|
-
return (
|
|
75550
|
+
var _a2;
|
|
75551
|
+
return (_a2 = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType)) == null ? void 0 : _a2.type;
|
|
75498
75552
|
},
|
|
75499
75553
|
/*noReductions*/
|
|
75500
75554
|
true
|
|
@@ -75636,8 +75690,8 @@ function createTypeChecker(host) {
|
|
|
75636
75690
|
),
|
|
75637
75691
|
map(
|
|
75638
75692
|
filter(getPropertiesOfType(contextualType), (s) => {
|
|
75639
|
-
var
|
|
75640
|
-
return !!(s.flags & 16777216 /* Optional */) && !!((
|
|
75693
|
+
var _a2;
|
|
75694
|
+
return !!(s.flags & 16777216 /* Optional */) && !!((_a2 = node == null ? void 0 : node.symbol) == null ? void 0 : _a2.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName);
|
|
75641
75695
|
}),
|
|
75642
75696
|
(s) => [() => undefinedType, s.escapedName]
|
|
75643
75697
|
)
|
|
@@ -75663,8 +75717,8 @@ function createTypeChecker(host) {
|
|
|
75663
75717
|
),
|
|
75664
75718
|
map(
|
|
75665
75719
|
filter(getPropertiesOfType(contextualType), (s) => {
|
|
75666
|
-
var
|
|
75667
|
-
if (!(s.flags & 16777216 /* Optional */) || !((
|
|
75720
|
+
var _a2;
|
|
75721
|
+
if (!(s.flags & 16777216 /* Optional */) || !((_a2 = node == null ? void 0 : node.symbol) == null ? void 0 : _a2.members)) {
|
|
75668
75722
|
return false;
|
|
75669
75723
|
}
|
|
75670
75724
|
const element = node.parent.parent;
|
|
@@ -75723,7 +75777,7 @@ function createTypeChecker(host) {
|
|
|
75723
75777
|
return type;
|
|
75724
75778
|
}
|
|
75725
75779
|
function getContextualType2(node, contextFlags) {
|
|
75726
|
-
var
|
|
75780
|
+
var _a2;
|
|
75727
75781
|
if (node.flags & 67108864 /* InWithStatement */) {
|
|
75728
75782
|
return void 0;
|
|
75729
75783
|
}
|
|
@@ -75769,7 +75823,7 @@ function createTypeChecker(host) {
|
|
|
75769
75823
|
const arrayLiteral = parent2;
|
|
75770
75824
|
const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);
|
|
75771
75825
|
const elementIndex = indexOfNode(arrayLiteral.elements, node);
|
|
75772
|
-
const spreadIndices = (
|
|
75826
|
+
const spreadIndices = (_a2 = getNodeLinks(arrayLiteral)).spreadIndices ?? (_a2.spreadIndices = getSpreadIndices(arrayLiteral.elements));
|
|
75773
75827
|
return getContextualTypeForElementExpression(type, elementIndex, arrayLiteral.elements.length, spreadIndices.first, spreadIndices.last);
|
|
75774
75828
|
}
|
|
75775
75829
|
case 227 /* ConditionalExpression */:
|
|
@@ -76301,13 +76355,13 @@ function createTypeChecker(host) {
|
|
|
76301
76355
|
return links.resolvedType;
|
|
76302
76356
|
}
|
|
76303
76357
|
function isSymbolWithNumericName(symbol) {
|
|
76304
|
-
var
|
|
76305
|
-
const firstDecl = (
|
|
76358
|
+
var _a2;
|
|
76359
|
+
const firstDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2[0];
|
|
76306
76360
|
return isNumericLiteralName(symbol.escapedName) || firstDecl && isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name);
|
|
76307
76361
|
}
|
|
76308
76362
|
function isSymbolWithSymbolName(symbol) {
|
|
76309
|
-
var
|
|
76310
|
-
const firstDecl = (
|
|
76363
|
+
var _a2;
|
|
76364
|
+
const firstDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2[0];
|
|
76311
76365
|
return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
|
|
76312
76366
|
}
|
|
76313
76367
|
function getObjectLiteralIndexInfo(node, offset, properties, keyType) {
|
|
@@ -76337,7 +76391,7 @@ function createTypeChecker(host) {
|
|
|
76337
76391
|
return links.immediateTarget;
|
|
76338
76392
|
}
|
|
76339
76393
|
function checkObjectLiteral(node, checkMode = 0 /* Normal */) {
|
|
76340
|
-
var
|
|
76394
|
+
var _a2;
|
|
76341
76395
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
76342
76396
|
checkGrammarObjectLiteralExpression(node, inDestructuringPattern);
|
|
76343
76397
|
const allPropertiesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
@@ -76478,7 +76532,7 @@ function createTypeChecker(host) {
|
|
|
76478
76532
|
for (const prop of getPropertiesOfType(contextualType)) {
|
|
76479
76533
|
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
|
|
76480
76534
|
if (!(prop.flags & 16777216 /* Optional */)) {
|
|
76481
|
-
error2(prop.valueDeclaration || ((
|
|
76535
|
+
error2(prop.valueDeclaration || ((_a2 = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a2.links.bindingElement), Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
|
|
76482
76536
|
}
|
|
76483
76537
|
propertiesTable.set(prop.escapedName, prop);
|
|
76484
76538
|
propertiesArray.push(prop);
|
|
@@ -76942,7 +76996,7 @@ function createTypeChecker(host) {
|
|
|
76942
76996
|
}
|
|
76943
76997
|
}
|
|
76944
76998
|
function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
|
|
76945
|
-
var
|
|
76999
|
+
var _a2;
|
|
76946
77000
|
Debug.assert(isJsxIntrinsicTagName(node.tagName));
|
|
76947
77001
|
const links = getNodeLinks(node);
|
|
76948
77002
|
if (!links.resolvedJsxElementAttributesType) {
|
|
@@ -76951,7 +77005,7 @@ function createTypeChecker(host) {
|
|
|
76951
77005
|
return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType;
|
|
76952
77006
|
} else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {
|
|
76953
77007
|
const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
|
|
76954
|
-
return links.resolvedJsxElementAttributesType = ((
|
|
77008
|
+
return links.resolvedJsxElementAttributesType = ((_a2 = getApplicableIndexInfoForName(getJsxType(JsxNames.IntrinsicElements, node), propName)) == null ? void 0 : _a2.type) || errorType;
|
|
76955
77009
|
} else {
|
|
76956
77010
|
return links.resolvedJsxElementAttributesType = errorType;
|
|
76957
77011
|
}
|
|
@@ -77128,7 +77182,7 @@ function createTypeChecker(host) {
|
|
|
77128
77182
|
return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
|
|
77129
77183
|
}
|
|
77130
77184
|
function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
|
|
77131
|
-
var
|
|
77185
|
+
var _a2;
|
|
77132
77186
|
const flags = getDeclarationModifierFlagsFromSymbol(prop, writing);
|
|
77133
77187
|
if (isSuper) {
|
|
77134
77188
|
if (languageVersion < 2 /* ES2015 */) {
|
|
@@ -77145,7 +77199,7 @@ function createTypeChecker(host) {
|
|
|
77145
77199
|
}
|
|
77146
77200
|
return false;
|
|
77147
77201
|
}
|
|
77148
|
-
if (!(flags & 256 /* Static */) && ((
|
|
77202
|
+
if (!(flags & 256 /* Static */) && ((_a2 = prop.declarations) == null ? void 0 : _a2.some(isClassInstanceProperty))) {
|
|
77149
77203
|
if (errorNode) {
|
|
77150
77204
|
error2(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
|
77151
77205
|
}
|
|
@@ -77532,7 +77586,7 @@ function createTypeChecker(host) {
|
|
|
77532
77586
|
error2(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
|
|
77533
77587
|
}
|
|
77534
77588
|
propType = indexInfo.type;
|
|
77535
|
-
if (
|
|
77589
|
+
if (noUncheckedIndexedAccess && getAssignmentTargetKind(node) !== 1 /* Definite */) {
|
|
77536
77590
|
propType = getUnionType([propType, missingType]);
|
|
77537
77591
|
}
|
|
77538
77592
|
if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) {
|
|
@@ -77559,12 +77613,12 @@ function createTypeChecker(host) {
|
|
|
77559
77613
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
77560
77614
|
}
|
|
77561
77615
|
function isUncheckedJSSuggestion(node, suggestion, excludeClasses) {
|
|
77562
|
-
var
|
|
77616
|
+
var _a2;
|
|
77563
77617
|
const file = getSourceFileOfNode(node);
|
|
77564
77618
|
if (file) {
|
|
77565
77619
|
if (compilerOptions.checkJs === void 0 && file.checkJsDirective === void 0 && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */)) {
|
|
77566
77620
|
const declarationFile = forEach(suggestion == null ? void 0 : suggestion.declarations, getSourceFileOfNode);
|
|
77567
|
-
const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((
|
|
77621
|
+
const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((_a2 = suggestion.valueDeclaration.heritageClauses) == null ? void 0 : _a2.length) || classOrConstructorParameterIsDecorated(
|
|
77568
77622
|
/*useLegacyDecorators*/
|
|
77569
77623
|
false,
|
|
77570
77624
|
suggestion.valueDeclaration
|
|
@@ -78362,7 +78416,7 @@ function createTypeChecker(host) {
|
|
|
78362
78416
|
errorOutputContainer
|
|
78363
78417
|
);
|
|
78364
78418
|
function checkTagNameDoesNotExpectTooManyArguments() {
|
|
78365
|
-
var
|
|
78419
|
+
var _a2;
|
|
78366
78420
|
if (getJsxNamespaceContainerForImplicitImport(node)) {
|
|
78367
78421
|
return true;
|
|
78368
78422
|
}
|
|
@@ -78428,7 +78482,7 @@ function createTypeChecker(host) {
|
|
|
78428
78482
|
}
|
|
78429
78483
|
if (reportErrors2) {
|
|
78430
78484
|
const diag2 = createDiagnosticForNode(node.tagName, Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, entityNameToString(node.tagName), absoluteMinArgCount, entityNameToString(factory2), maxParamCount);
|
|
78431
|
-
const tagNameDeclaration = (
|
|
78485
|
+
const tagNameDeclaration = (_a2 = getSymbolAtLocation(node.tagName)) == null ? void 0 : _a2.valueDeclaration;
|
|
78432
78486
|
if (tagNameDeclaration) {
|
|
78433
78487
|
addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics._0_is_declared_here, entityNameToString(node.tagName)));
|
|
78434
78488
|
}
|
|
@@ -78577,9 +78631,9 @@ function createTypeChecker(host) {
|
|
|
78577
78631
|
const spreadType = arg.kind === 230 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
78578
78632
|
if (spreadType && isTupleType(spreadType)) {
|
|
78579
78633
|
forEach(getElementTypes(spreadType), (t, i2) => {
|
|
78580
|
-
var
|
|
78634
|
+
var _a2;
|
|
78581
78635
|
const flags = spreadType.target.elementFlags[i2];
|
|
78582
|
-
const syntheticArg = createSyntheticExpression(arg, flags & 4 /* Rest */ ? createArrayType(t) : t, !!(flags & 12 /* Variable */), (
|
|
78636
|
+
const syntheticArg = createSyntheticExpression(arg, flags & 4 /* Rest */ ? createArrayType(t) : t, !!(flags & 12 /* Variable */), (_a2 = spreadType.target.labeledElementDeclarations) == null ? void 0 : _a2[i2]);
|
|
78583
78637
|
effectiveArgs.push(syntheticArg);
|
|
78584
78638
|
});
|
|
78585
78639
|
} else {
|
|
@@ -78687,7 +78741,7 @@ function createTypeChecker(host) {
|
|
|
78687
78741
|
return constructorSymbol === globalPromiseSymbol;
|
|
78688
78742
|
}
|
|
78689
78743
|
function getArgumentArityError(node, signatures, args, headMessage) {
|
|
78690
|
-
var
|
|
78744
|
+
var _a2;
|
|
78691
78745
|
const spreadIndex = getSpreadArgumentIndex(args);
|
|
78692
78746
|
if (spreadIndex > -1) {
|
|
78693
78747
|
return createDiagnosticForNode(args[spreadIndex], Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);
|
|
@@ -78746,7 +78800,7 @@ function createTypeChecker(host) {
|
|
|
78746
78800
|
} else {
|
|
78747
78801
|
diagnostic = getDiagnosticForCallNode(node, error3, parameterRange, args.length);
|
|
78748
78802
|
}
|
|
78749
|
-
const parameter = (
|
|
78803
|
+
const parameter = (_a2 = closestSignature == null ? void 0 : closestSignature.declaration) == null ? void 0 : _a2.parameters[closestSignature.thisParameter ? args.length + 1 : args.length];
|
|
78750
78804
|
if (parameter) {
|
|
78751
78805
|
const messageAndArgs = isBindingPattern(parameter.name) ? [Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided] : isRestParameter(parameter) ? [Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided, idText(getFirstIdentifier(parameter.name))] : [Diagnostics.An_argument_for_0_was_not_provided, !parameter.name ? args.length : idText(getFirstIdentifier(parameter.name))];
|
|
78752
78806
|
const parameterError = createDiagnosticForNode(parameter, ...messageAndArgs);
|
|
@@ -78986,11 +79040,11 @@ function createTypeChecker(host) {
|
|
|
78986
79040
|
}
|
|
78987
79041
|
return result;
|
|
78988
79042
|
function addImplementationSuccessElaboration(failed, diagnostic) {
|
|
78989
|
-
var
|
|
79043
|
+
var _a2, _b;
|
|
78990
79044
|
const oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
78991
79045
|
const oldCandidateForArgumentArityError = candidateForArgumentArityError;
|
|
78992
79046
|
const oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
|
|
78993
|
-
const failedSignatureDeclarations = ((_b = (
|
|
79047
|
+
const failedSignatureDeclarations = ((_b = (_a2 = failed.declaration) == null ? void 0 : _a2.symbol) == null ? void 0 : _b.declarations) || emptyArray;
|
|
78994
79048
|
const isOverload2 = failedSignatureDeclarations.length > 1;
|
|
78995
79049
|
const implDecl = isOverload2 ? find(failedSignatureDeclarations, (d) => isFunctionLikeDeclaration(d) && nodeIsPresent(d.body)) : void 0;
|
|
78996
79050
|
if (implDecl) {
|
|
@@ -79005,7 +79059,7 @@ function createTypeChecker(host) {
|
|
|
79005
79059
|
candidateForTypeArgumentError = oldCandidateForTypeArgumentError;
|
|
79006
79060
|
}
|
|
79007
79061
|
function chooseOverload(candidates2, relation, isSingleNonGenericCandidate2, signatureHelpTrailingComma2 = false) {
|
|
79008
|
-
var
|
|
79062
|
+
var _a2, _b;
|
|
79009
79063
|
candidatesForArgumentError = void 0;
|
|
79010
79064
|
candidateForArgumentArityError = void 0;
|
|
79011
79065
|
candidateForTypeArgumentError = void 0;
|
|
@@ -79040,7 +79094,7 @@ function createTypeChecker(host) {
|
|
|
79040
79094
|
let checkCandidate;
|
|
79041
79095
|
let inferenceContext;
|
|
79042
79096
|
if (candidate.typeParameters) {
|
|
79043
|
-
const paramLocation = (_b = (
|
|
79097
|
+
const paramLocation = (_b = (_a2 = candidate.typeParameters[0].symbol.declarations) == null ? void 0 : _a2[0]) == null ? void 0 : _b.parent;
|
|
79044
79098
|
const candidateParameterContext = paramLocation || (candidate.declaration && isConstructorDeclaration(candidate.declaration) ? candidate.declaration.parent : candidate.declaration);
|
|
79045
79099
|
if (candidateParameterContext && findAncestor(node, (a) => a === candidateParameterContext)) {
|
|
79046
79100
|
candidate = getImplementationSignature(candidate);
|
|
@@ -79729,7 +79783,7 @@ function createTypeChecker(host) {
|
|
|
79729
79783
|
return result;
|
|
79730
79784
|
}
|
|
79731
79785
|
function isJSConstructor(node) {
|
|
79732
|
-
var
|
|
79786
|
+
var _a2;
|
|
79733
79787
|
if (!node || !isInJSFile(node)) {
|
|
79734
79788
|
return false;
|
|
79735
79789
|
}
|
|
@@ -79740,12 +79794,12 @@ function createTypeChecker(host) {
|
|
|
79740
79794
|
if (isPropertyAssignment(walkUpParenthesizedExpressions(func.parent)))
|
|
79741
79795
|
return false;
|
|
79742
79796
|
const symbol = getSymbolOfDeclaration(func);
|
|
79743
|
-
return !!((
|
|
79797
|
+
return !!((_a2 = symbol == null ? void 0 : symbol.members) == null ? void 0 : _a2.size);
|
|
79744
79798
|
}
|
|
79745
79799
|
return false;
|
|
79746
79800
|
}
|
|
79747
79801
|
function mergeJSSymbols(target, source) {
|
|
79748
|
-
var
|
|
79802
|
+
var _a2, _b;
|
|
79749
79803
|
if (source) {
|
|
79750
79804
|
const links = getSymbolLinks(source);
|
|
79751
79805
|
if (!links.inferredClassSymbol || !links.inferredClassSymbol.has(getSymbolId(target))) {
|
|
@@ -79753,7 +79807,7 @@ function createTypeChecker(host) {
|
|
|
79753
79807
|
inferred.exports = inferred.exports || createSymbolTable();
|
|
79754
79808
|
inferred.members = inferred.members || createSymbolTable();
|
|
79755
79809
|
inferred.flags |= source.flags & 32 /* Class */;
|
|
79756
|
-
if ((
|
|
79810
|
+
if ((_a2 = source.exports) == null ? void 0 : _a2.size) {
|
|
79757
79811
|
mergeSymbolTable(inferred.exports, source.exports);
|
|
79758
79812
|
}
|
|
79759
79813
|
if ((_b = source.members) == null ? void 0 : _b.size) {
|
|
@@ -79766,13 +79820,13 @@ function createTypeChecker(host) {
|
|
|
79766
79820
|
}
|
|
79767
79821
|
}
|
|
79768
79822
|
function getAssignedClassSymbol(decl) {
|
|
79769
|
-
var
|
|
79823
|
+
var _a2;
|
|
79770
79824
|
const assignmentSymbol = decl && getSymbolOfExpando(
|
|
79771
79825
|
decl,
|
|
79772
79826
|
/*allowDeclaration*/
|
|
79773
79827
|
true
|
|
79774
79828
|
);
|
|
79775
|
-
const prototype = (
|
|
79829
|
+
const prototype = (_a2 = assignmentSymbol == null ? void 0 : assignmentSymbol.exports) == null ? void 0 : _a2.get("prototype");
|
|
79776
79830
|
const init = (prototype == null ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration);
|
|
79777
79831
|
return init ? getSymbolOfDeclaration(init) : void 0;
|
|
79778
79832
|
}
|
|
@@ -79829,7 +79883,7 @@ function createTypeChecker(host) {
|
|
|
79829
79883
|
}
|
|
79830
79884
|
}
|
|
79831
79885
|
function checkCallExpression(node, checkMode) {
|
|
79832
|
-
var
|
|
79886
|
+
var _a2, _b, _c;
|
|
79833
79887
|
checkGrammarTypeArguments(node, node.typeArguments);
|
|
79834
79888
|
const signature = getResolvedSignature(
|
|
79835
79889
|
node,
|
|
@@ -79846,7 +79900,7 @@ function createTypeChecker(host) {
|
|
|
79846
79900
|
}
|
|
79847
79901
|
if (node.kind === 214 /* NewExpression */) {
|
|
79848
79902
|
const declaration = signature.declaration;
|
|
79849
|
-
if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (
|
|
79903
|
+
if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a2 = getJSDocRoot(declaration)) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 176 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
|
|
79850
79904
|
if (noImplicitAny) {
|
|
79851
79905
|
error2(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
|
|
79852
79906
|
}
|
|
@@ -80005,11 +80059,11 @@ function createTypeChecker(host) {
|
|
|
80005
80059
|
return void 0;
|
|
80006
80060
|
}
|
|
80007
80061
|
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) {
|
|
80008
|
-
var
|
|
80062
|
+
var _a2;
|
|
80009
80063
|
if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
|
|
80010
80064
|
const synthType = type;
|
|
80011
80065
|
if (!synthType.syntheticType) {
|
|
80012
|
-
const file = (
|
|
80066
|
+
const file = (_a2 = originalSymbol.declarations) == null ? void 0 : _a2.find(isSourceFile);
|
|
80013
80067
|
const hasSyntheticDefault = canHaveSyntheticDefault(
|
|
80014
80068
|
file,
|
|
80015
80069
|
originalSymbol,
|
|
@@ -80343,8 +80397,8 @@ function createTypeChecker(host) {
|
|
|
80343
80397
|
return restParameter.escapedName;
|
|
80344
80398
|
}
|
|
80345
80399
|
function getParameterIdentifierInfoAtPosition(signature, pos) {
|
|
80346
|
-
var
|
|
80347
|
-
if (((
|
|
80400
|
+
var _a2;
|
|
80401
|
+
if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 317 /* JSDocFunctionType */) {
|
|
80348
80402
|
return void 0;
|
|
80349
80403
|
}
|
|
80350
80404
|
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
@@ -81454,7 +81508,7 @@ function createTypeChecker(host) {
|
|
|
81454
81508
|
return !!(getCheckFlags(symbol) & 8 /* Readonly */ || symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) & 8 /* Readonly */ || symbol.flags & 3 /* Variable */ && getDeclarationNodeFlagsFromSymbol(symbol) & 6 /* Constant */ || symbol.flags & 98304 /* Accessor */ && !(symbol.flags & 65536 /* SetAccessor */) || symbol.flags & 8 /* EnumMember */ || some(symbol.declarations, isReadonlyAssignmentDeclaration));
|
|
81455
81509
|
}
|
|
81456
81510
|
function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) {
|
|
81457
|
-
var
|
|
81511
|
+
var _a2, _b;
|
|
81458
81512
|
if (assignmentKind === 0 /* None */) {
|
|
81459
81513
|
return false;
|
|
81460
81514
|
}
|
|
@@ -81468,7 +81522,7 @@ function createTypeChecker(host) {
|
|
|
81468
81522
|
const isAssignmentDeclaration2 = isBinaryExpression(symbol.valueDeclaration);
|
|
81469
81523
|
const isLocalPropertyDeclaration = ctor.parent === symbol.valueDeclaration.parent;
|
|
81470
81524
|
const isLocalParameterProperty = ctor === symbol.valueDeclaration.parent;
|
|
81471
|
-
const isLocalThisPropertyAssignment = isAssignmentDeclaration2 && ((
|
|
81525
|
+
const isLocalThisPropertyAssignment = isAssignmentDeclaration2 && ((_a2 = symbol.parent) == null ? void 0 : _a2.valueDeclaration) === ctor.parent;
|
|
81472
81526
|
const isLocalThisPropertyAssignmentConstructorFunction = isAssignmentDeclaration2 && ((_b = symbol.parent) == null ? void 0 : _b.valueDeclaration) === ctor;
|
|
81473
81527
|
const isWriteableSymbol = isLocalPropertyDeclaration || isLocalParameterProperty || isLocalThisPropertyAssignment || isLocalThisPropertyAssignmentConstructorFunction;
|
|
81474
81528
|
return !isWriteableSymbol;
|
|
@@ -81866,7 +81920,7 @@ function createTypeChecker(host) {
|
|
|
81866
81920
|
checkExternalEmitHelpers(node, 512 /* Read */);
|
|
81867
81921
|
}
|
|
81868
81922
|
const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType;
|
|
81869
|
-
let inBoundsType =
|
|
81923
|
+
let inBoundsType = noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType;
|
|
81870
81924
|
for (let i = 0; i < elements.length; i++) {
|
|
81871
81925
|
let type = possiblyOutOfBoundsType;
|
|
81872
81926
|
if (node.elements[i].kind === 230 /* SpreadElement */) {
|
|
@@ -82455,7 +82509,7 @@ function createTypeChecker(host) {
|
|
|
82455
82509
|
}
|
|
82456
82510
|
}
|
|
82457
82511
|
function isAssignmentDeclaration2(kind) {
|
|
82458
|
-
var
|
|
82512
|
+
var _a2;
|
|
82459
82513
|
switch (kind) {
|
|
82460
82514
|
case 2 /* ModuleExports */:
|
|
82461
82515
|
return true;
|
|
@@ -82466,7 +82520,7 @@ function createTypeChecker(host) {
|
|
|
82466
82520
|
case 4 /* ThisProperty */:
|
|
82467
82521
|
const symbol = getSymbolOfNode(left);
|
|
82468
82522
|
const init = getAssignedExpandoInitializer(right);
|
|
82469
|
-
return !!init && isObjectLiteralExpression(init) && !!((
|
|
82523
|
+
return !!init && isObjectLiteralExpression(init) && !!((_a2 = symbol == null ? void 0 : symbol.exports) == null ? void 0 : _a2.size);
|
|
82470
82524
|
default:
|
|
82471
82525
|
return false;
|
|
82472
82526
|
}
|
|
@@ -83016,8 +83070,8 @@ function createTypeChecker(host) {
|
|
|
83016
83070
|
return type;
|
|
83017
83071
|
}
|
|
83018
83072
|
function checkExpression(node, checkMode, forceTuple) {
|
|
83019
|
-
var
|
|
83020
|
-
(
|
|
83073
|
+
var _a2, _b;
|
|
83074
|
+
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Check, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
83021
83075
|
const saveCurrentNode = currentNode;
|
|
83022
83076
|
currentNode = node;
|
|
83023
83077
|
instantiationCount = 0;
|
|
@@ -83192,7 +83246,7 @@ function createTypeChecker(host) {
|
|
|
83192
83246
|
addLazyDiagnostic(() => checkTypeNameIsReserved(node.name, Diagnostics.Type_parameter_name_cannot_be_0));
|
|
83193
83247
|
}
|
|
83194
83248
|
function checkTypeParameterDeferred(node) {
|
|
83195
|
-
var
|
|
83249
|
+
var _a2, _b;
|
|
83196
83250
|
if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) {
|
|
83197
83251
|
const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node));
|
|
83198
83252
|
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
@@ -83201,7 +83255,7 @@ function createTypeChecker(host) {
|
|
|
83201
83255
|
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
83202
83256
|
error2(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
83203
83257
|
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
83204
|
-
(
|
|
83258
|
+
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
83205
83259
|
const source = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSubTypeForCheck : markerSuperTypeForCheck);
|
|
83206
83260
|
const target = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSuperTypeForCheck : markerSubTypeForCheck);
|
|
83207
83261
|
const saveVarianceTypeParameter = typeParameter;
|
|
@@ -83911,8 +83965,8 @@ function createTypeChecker(host) {
|
|
|
83911
83965
|
}
|
|
83912
83966
|
}
|
|
83913
83967
|
function checkGrammarMappedType(node) {
|
|
83914
|
-
var
|
|
83915
|
-
if ((
|
|
83968
|
+
var _a2;
|
|
83969
|
+
if ((_a2 = node.members) == null ? void 0 : _a2.length) {
|
|
83916
83970
|
return grammarErrorOnNode(node.members[0], Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);
|
|
83917
83971
|
}
|
|
83918
83972
|
}
|
|
@@ -84346,13 +84400,13 @@ function createTypeChecker(host) {
|
|
|
84346
84400
|
return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0;
|
|
84347
84401
|
}
|
|
84348
84402
|
function isAwaitedTypeInstantiation(type) {
|
|
84349
|
-
var
|
|
84403
|
+
var _a2;
|
|
84350
84404
|
if (type.flags & 16777216 /* Conditional */) {
|
|
84351
84405
|
const awaitedSymbol = getGlobalAwaitedSymbol(
|
|
84352
84406
|
/*reportErrors*/
|
|
84353
84407
|
false
|
|
84354
84408
|
);
|
|
84355
|
-
return !!awaitedSymbol && type.aliasSymbol === awaitedSymbol && ((
|
|
84409
|
+
return !!awaitedSymbol && type.aliasSymbol === awaitedSymbol && ((_a2 = type.aliasTypeArguments) == null ? void 0 : _a2.length) === 1;
|
|
84356
84410
|
}
|
|
84357
84411
|
return false;
|
|
84358
84412
|
}
|
|
@@ -84938,7 +84992,7 @@ function createTypeChecker(host) {
|
|
|
84938
84992
|
}
|
|
84939
84993
|
}
|
|
84940
84994
|
function checkFunctionOrMethodDeclaration(node) {
|
|
84941
|
-
var
|
|
84995
|
+
var _a2;
|
|
84942
84996
|
checkDecorators(node);
|
|
84943
84997
|
checkSignatureDeclaration(node);
|
|
84944
84998
|
const functionFlags = getFunctionFlags(node);
|
|
@@ -84948,7 +85002,7 @@ function createTypeChecker(host) {
|
|
|
84948
85002
|
if (hasBindableName(node)) {
|
|
84949
85003
|
const symbol = getSymbolOfDeclaration(node);
|
|
84950
85004
|
const localSymbol = node.localSymbol || symbol;
|
|
84951
|
-
const firstDeclaration = (
|
|
85005
|
+
const firstDeclaration = (_a2 = localSymbol.declarations) == null ? void 0 : _a2.find(
|
|
84952
85006
|
// Get first non javascript function declaration
|
|
84953
85007
|
(declaration) => declaration.kind === node.kind && !(declaration.flags & 524288 /* JavaScriptFile */)
|
|
84954
85008
|
);
|
|
@@ -85222,9 +85276,9 @@ function createTypeChecker(host) {
|
|
|
85222
85276
|
});
|
|
85223
85277
|
}
|
|
85224
85278
|
function checkPotentialUncheckedRenamedBindingElementsInTypes() {
|
|
85225
|
-
var
|
|
85279
|
+
var _a2;
|
|
85226
85280
|
for (const node of potentialUnusedRenamedBindingElementsInTypes) {
|
|
85227
|
-
if (!((
|
|
85281
|
+
if (!((_a2 = getSymbolOfDeclaration(node)) == null ? void 0 : _a2.isReferenced)) {
|
|
85228
85282
|
const wrappingDeclaration = walkUpBindingElementsAndPatterns(node);
|
|
85229
85283
|
Debug.assert(isPartOfParameterDeclaration(wrappingDeclaration), "Only parameter declaration should be checked here");
|
|
85230
85284
|
const diagnostic = createDiagnosticForNode(node.name, Diagnostics._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation, declarationNameToString(node.name), declarationNameToString(node.propertyName));
|
|
@@ -85447,7 +85501,7 @@ function createTypeChecker(host) {
|
|
|
85447
85501
|
return type === autoType ? anyType : type === autoArrayType ? anyArrayType : type;
|
|
85448
85502
|
}
|
|
85449
85503
|
function checkVariableLikeDeclaration(node) {
|
|
85450
|
-
var
|
|
85504
|
+
var _a2;
|
|
85451
85505
|
checkDecorators(node);
|
|
85452
85506
|
if (!isBindingElement(node)) {
|
|
85453
85507
|
checkSourceElement(node.type);
|
|
@@ -85546,7 +85600,7 @@ function createTypeChecker(host) {
|
|
|
85546
85600
|
if (node === symbol.valueDeclaration) {
|
|
85547
85601
|
const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node);
|
|
85548
85602
|
if (initializer) {
|
|
85549
|
-
const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((
|
|
85603
|
+
const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a2 = symbol.exports) == null ? void 0 : _a2.size);
|
|
85550
85604
|
if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 249 /* ForInStatement */) {
|
|
85551
85605
|
const initializerType = checkExpressionCached(initializer);
|
|
85552
85606
|
checkTypeAssignableToAndOptionallyElaborate(
|
|
@@ -85641,8 +85695,8 @@ function createTypeChecker(host) {
|
|
|
85641
85695
|
return getSelectedEffectiveModifierFlags(left, interestingFlags) === getSelectedEffectiveModifierFlags(right, interestingFlags);
|
|
85642
85696
|
}
|
|
85643
85697
|
function checkVariableDeclaration(node) {
|
|
85644
|
-
var
|
|
85645
|
-
(
|
|
85698
|
+
var _a2, _b;
|
|
85699
|
+
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Check, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
85646
85700
|
checkGrammarVariableDeclaration(node);
|
|
85647
85701
|
checkVariableLikeDeclaration(node);
|
|
85648
85702
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
@@ -85920,7 +85974,7 @@ function createTypeChecker(host) {
|
|
|
85920
85974
|
}
|
|
85921
85975
|
const uplevelIteration = languageVersion >= 2 /* ES2015 */;
|
|
85922
85976
|
const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
|
|
85923
|
-
const possibleOutOfBounds =
|
|
85977
|
+
const possibleOutOfBounds = noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */);
|
|
85924
85978
|
if (uplevelIteration || downlevelIteration || allowAsyncIterables) {
|
|
85925
85979
|
const iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : void 0);
|
|
85926
85980
|
if (checkAssignability) {
|
|
@@ -85969,14 +86023,14 @@ function createTypeChecker(host) {
|
|
|
85969
86023
|
}
|
|
85970
86024
|
const arrayElementType = getIndexTypeOfType(arrayType, numberType);
|
|
85971
86025
|
if (hasStringConstituent && arrayElementType) {
|
|
85972
|
-
if (arrayElementType.flags & 402653316 /* StringLike */ && !
|
|
86026
|
+
if (arrayElementType.flags & 402653316 /* StringLike */ && !noUncheckedIndexedAccess) {
|
|
85973
86027
|
return stringType;
|
|
85974
86028
|
}
|
|
85975
86029
|
return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */);
|
|
85976
86030
|
}
|
|
85977
86031
|
return use & 128 /* PossiblyOutOfBounds */ ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType;
|
|
85978
86032
|
function getIterationDiagnosticDetails(allowsStrings, downlevelIteration2) {
|
|
85979
|
-
var
|
|
86033
|
+
var _a2;
|
|
85980
86034
|
if (downlevelIteration2) {
|
|
85981
86035
|
return allowsStrings ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true] : [Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true];
|
|
85982
86036
|
}
|
|
@@ -85990,7 +86044,7 @@ function createTypeChecker(host) {
|
|
|
85990
86044
|
if (yieldType) {
|
|
85991
86045
|
return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false];
|
|
85992
86046
|
}
|
|
85993
|
-
if (isES2015OrLaterIterable((
|
|
86047
|
+
if (isES2015OrLaterIterable((_a2 = inputType.symbol) == null ? void 0 : _a2.escapedName)) {
|
|
85994
86048
|
return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, true];
|
|
85995
86049
|
}
|
|
85996
86050
|
return allowsStrings ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true] : [Diagnostics.Type_0_is_not_an_array_type, true];
|
|
@@ -86062,7 +86116,7 @@ function createTypeChecker(host) {
|
|
|
86062
86116
|
return type[cacheKey] = cachedTypes2;
|
|
86063
86117
|
}
|
|
86064
86118
|
function getIterationTypesOfIterable(type, use, errorNode) {
|
|
86065
|
-
var
|
|
86119
|
+
var _a2, _b;
|
|
86066
86120
|
if (isTypeAny(type)) {
|
|
86067
86121
|
return anyIterationTypes;
|
|
86068
86122
|
}
|
|
@@ -86077,7 +86131,7 @@ function createTypeChecker(host) {
|
|
|
86077
86131
|
}
|
|
86078
86132
|
}
|
|
86079
86133
|
return void 0;
|
|
86080
|
-
} else if ((
|
|
86134
|
+
} else if ((_a2 = errorOutputContainer == null ? void 0 : errorOutputContainer.errors) == null ? void 0 : _a2.length) {
|
|
86081
86135
|
for (const diag2 of errorOutputContainer.errors) {
|
|
86082
86136
|
diagnostics.add(diag2);
|
|
86083
86137
|
}
|
|
@@ -86385,7 +86439,7 @@ function createTypeChecker(host) {
|
|
|
86385
86439
|
));
|
|
86386
86440
|
}
|
|
86387
86441
|
function getIterationTypesOfMethod(type, resolver, methodName, errorNode, errorOutputContainer) {
|
|
86388
|
-
var
|
|
86442
|
+
var _a2, _b, _c, _d;
|
|
86389
86443
|
const method = getPropertyOfType(type, methodName);
|
|
86390
86444
|
if (!method && methodName !== "next") {
|
|
86391
86445
|
return void 0;
|
|
@@ -86416,7 +86470,7 @@ function createTypeChecker(host) {
|
|
|
86416
86470
|
/*reportErrors*/
|
|
86417
86471
|
false
|
|
86418
86472
|
);
|
|
86419
|
-
const isGeneratorMethod = ((_b = (
|
|
86473
|
+
const isGeneratorMethod = ((_b = (_a2 = globalGeneratorType.symbol) == null ? void 0 : _a2.members) == null ? void 0 : _b.get(methodName)) === methodType.symbol;
|
|
86420
86474
|
const isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) == null ? void 0 : _c.members) == null ? void 0 : _d.get(methodName)) === methodType.symbol;
|
|
86421
86475
|
if (isGeneratorMethod || isIteratorMethod) {
|
|
86422
86476
|
const globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType;
|
|
@@ -87288,7 +87342,7 @@ function createTypeChecker(host) {
|
|
|
87288
87342
|
return filter(symbol.declarations, (d) => d.kind === 263 /* ClassDeclaration */ || d.kind === 264 /* InterfaceDeclaration */);
|
|
87289
87343
|
}
|
|
87290
87344
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
87291
|
-
var
|
|
87345
|
+
var _a2, _b, _c, _d, _e;
|
|
87292
87346
|
const baseProperties = getPropertiesOfType(baseType);
|
|
87293
87347
|
const notImplementedInfo = /* @__PURE__ */ new Map();
|
|
87294
87348
|
basePropertyCheck:
|
|
@@ -87319,7 +87373,7 @@ function createTypeChecker(host) {
|
|
|
87319
87373
|
const baseTypeName = typeToString(baseType);
|
|
87320
87374
|
const typeName = typeToString(type);
|
|
87321
87375
|
const basePropertyName = symbolToString(baseProperty);
|
|
87322
|
-
const missedProperties = append((
|
|
87376
|
+
const missedProperties = append((_a2 = notImplementedInfo.get(derivedClassDecl)) == null ? void 0 : _a2.missedProperties, basePropertyName);
|
|
87323
87377
|
notImplementedInfo.set(derivedClassDecl, { baseTypeName, typeName, missedProperties });
|
|
87324
87378
|
}
|
|
87325
87379
|
} else {
|
|
@@ -87331,7 +87385,7 @@ function createTypeChecker(host) {
|
|
|
87331
87385
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
87332
87386
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
87333
87387
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
87334
|
-
if ((getCheckFlags(base) & 6 /*
|
|
87388
|
+
if ((getCheckFlags(base) & 6 /* SyntheticMember */ ? (_b = base.declarations) == null ? void 0 : _b.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_c = base.declarations) == null ? void 0 : _c.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
87335
87389
|
continue;
|
|
87336
87390
|
}
|
|
87337
87391
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -87812,7 +87866,7 @@ function createTypeChecker(host) {
|
|
|
87812
87866
|
}
|
|
87813
87867
|
addLazyDiagnostic(checkModuleDeclarationDiagnostics);
|
|
87814
87868
|
function checkModuleDeclarationDiagnostics() {
|
|
87815
|
-
var
|
|
87869
|
+
var _a2, _b;
|
|
87816
87870
|
const isGlobalAugmentation = isGlobalScopeAugmentation(node);
|
|
87817
87871
|
const inAmbientContext = node.flags & 33554432 /* Ambient */;
|
|
87818
87872
|
if (isGlobalAugmentation && !inAmbientContext) {
|
|
@@ -87837,7 +87891,7 @@ function createTypeChecker(host) {
|
|
|
87837
87891
|
if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) {
|
|
87838
87892
|
error2(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName);
|
|
87839
87893
|
}
|
|
87840
|
-
if (((
|
|
87894
|
+
if (((_a2 = symbol.declarations) == null ? void 0 : _a2.length) > 1) {
|
|
87841
87895
|
const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
|
|
87842
87896
|
if (firstNonAmbientClassOrFunc) {
|
|
87843
87897
|
if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
|
@@ -87974,7 +88028,7 @@ function createTypeChecker(host) {
|
|
|
87974
88028
|
return true;
|
|
87975
88029
|
}
|
|
87976
88030
|
function checkAliasSymbol(node) {
|
|
87977
|
-
var
|
|
88031
|
+
var _a2, _b, _c, _d;
|
|
87978
88032
|
let symbol = getSymbolOfDeclaration(node);
|
|
87979
88033
|
const target = resolveAlias(symbol);
|
|
87980
88034
|
if (target !== unknownSymbol) {
|
|
@@ -87984,7 +88038,7 @@ function createTypeChecker(host) {
|
|
|
87984
88038
|
Debug.assert(node.kind !== 280 /* NamespaceExport */);
|
|
87985
88039
|
if (node.kind === 281 /* ExportSpecifier */) {
|
|
87986
88040
|
const diag2 = error2(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
|
|
87987
|
-
const alreadyExportedSymbol = (_b = (
|
|
88041
|
+
const alreadyExportedSymbol = (_b = (_a2 = getSourceFileOfNode(node).symbol) == null ? void 0 : _a2.exports) == null ? void 0 : _b.get((node.propertyName || node.name).escapedText);
|
|
87988
88042
|
if (alreadyExportedSymbol === target) {
|
|
87989
88043
|
const exportingDeclaration = (_c = alreadyExportedSymbol.declarations) == null ? void 0 : _c.find(isJSDocNode);
|
|
87990
88044
|
if (exportingDeclaration) {
|
|
@@ -88111,7 +88165,7 @@ function createTypeChecker(host) {
|
|
|
88111
88165
|
}
|
|
88112
88166
|
}
|
|
88113
88167
|
function checkImportAttributes(declaration) {
|
|
88114
|
-
var
|
|
88168
|
+
var _a2;
|
|
88115
88169
|
const node = declaration.attributes;
|
|
88116
88170
|
if (node) {
|
|
88117
88171
|
const importAttributesType = getGlobalImportAttributesType(
|
|
@@ -88132,7 +88186,7 @@ function createTypeChecker(host) {
|
|
|
88132
88186
|
const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve;
|
|
88133
88187
|
return grammarErrorOnNode(node, message);
|
|
88134
88188
|
}
|
|
88135
|
-
const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (
|
|
88189
|
+
const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (_a2 = declaration.importClause) == null ? void 0 : _a2.isTypeOnly : declaration.isTypeOnly);
|
|
88136
88190
|
if (isTypeOnly) {
|
|
88137
88191
|
return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
|
|
88138
88192
|
}
|
|
@@ -88245,8 +88299,8 @@ function createTypeChecker(host) {
|
|
|
88245
88299
|
checkImportAttributes(node);
|
|
88246
88300
|
}
|
|
88247
88301
|
function checkGrammarExportDeclaration(node) {
|
|
88248
|
-
var
|
|
88249
|
-
if (node.isTypeOnly && ((
|
|
88302
|
+
var _a2;
|
|
88303
|
+
if (node.isTypeOnly && ((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 279 /* NamedExports */) {
|
|
88250
88304
|
return checkGrammarNamedImportsOrExports(node.exportClause);
|
|
88251
88305
|
}
|
|
88252
88306
|
return false;
|
|
@@ -88748,8 +88802,8 @@ function createTypeChecker(host) {
|
|
|
88748
88802
|
links.deferredNodes = void 0;
|
|
88749
88803
|
}
|
|
88750
88804
|
function checkDeferredNode(node) {
|
|
88751
|
-
var
|
|
88752
|
-
(
|
|
88805
|
+
var _a2, _b;
|
|
88806
|
+
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Check, "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
88753
88807
|
const saveCurrentNode = currentNode;
|
|
88754
88808
|
currentNode = node;
|
|
88755
88809
|
instantiationCount = 0;
|
|
@@ -88801,8 +88855,8 @@ function createTypeChecker(host) {
|
|
|
88801
88855
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
88802
88856
|
}
|
|
88803
88857
|
function checkSourceFile(node) {
|
|
88804
|
-
var
|
|
88805
|
-
(
|
|
88858
|
+
var _a2, _b;
|
|
88859
|
+
(_a2 = tracing) == null ? void 0 : _a2.push(
|
|
88806
88860
|
tracing.Phase.Check,
|
|
88807
88861
|
"checkSourceFile",
|
|
88808
88862
|
{ path: node.path },
|
|
@@ -89596,7 +89650,7 @@ function createTypeChecker(host) {
|
|
|
89596
89650
|
return roots ? flatMap(roots, getRootSymbols) : [symbol];
|
|
89597
89651
|
}
|
|
89598
89652
|
function getImmediateRootSymbols(symbol) {
|
|
89599
|
-
if (getCheckFlags(symbol) & 6 /*
|
|
89653
|
+
if (getCheckFlags(symbol) & 6 /* SyntheticMember */) {
|
|
89600
89654
|
return mapDefined(getSymbolLinks(symbol).containingType.types, (type) => getPropertyOfType(type, symbol.escapedName));
|
|
89601
89655
|
} else if (symbol.flags & 33554432 /* Transient */) {
|
|
89602
89656
|
const { links: { leftSpread, rightSpread, syntheticOrigin } } = symbol;
|
|
@@ -89628,7 +89682,7 @@ function createTypeChecker(host) {
|
|
|
89628
89682
|
return isModuleOrEnumDeclaration(node.parent) && node === node.parent.name;
|
|
89629
89683
|
}
|
|
89630
89684
|
function getReferencedExportContainer(nodeIn, prefixLocals) {
|
|
89631
|
-
var
|
|
89685
|
+
var _a2;
|
|
89632
89686
|
const node = getParseTreeNode(nodeIn, isIdentifier);
|
|
89633
89687
|
if (node) {
|
|
89634
89688
|
let symbol = getReferencedValueSymbol(
|
|
@@ -89646,7 +89700,7 @@ function createTypeChecker(host) {
|
|
|
89646
89700
|
}
|
|
89647
89701
|
const parentSymbol = getParentOfSymbol(symbol);
|
|
89648
89702
|
if (parentSymbol) {
|
|
89649
|
-
if (parentSymbol.flags & 512 /* ValueModule */ && ((
|
|
89703
|
+
if (parentSymbol.flags & 512 /* ValueModule */ && ((_a2 = parentSymbol.valueDeclaration) == null ? void 0 : _a2.kind) === 307 /* SourceFile */) {
|
|
89650
89704
|
const symbolFile = parentSymbol.valueDeclaration;
|
|
89651
89705
|
const referenceFile = getSourceFileOfNode(node);
|
|
89652
89706
|
const symbolIsUmdExport = symbolFile !== referenceFile;
|
|
@@ -89873,11 +89927,11 @@ function createTypeChecker(host) {
|
|
|
89873
89927
|
return symbol && getPropertiesOfType(getTypeOfSymbol(symbol)) || emptyArray;
|
|
89874
89928
|
}
|
|
89875
89929
|
function getNodeCheckFlags(node) {
|
|
89876
|
-
var
|
|
89930
|
+
var _a2;
|
|
89877
89931
|
const nodeId = node.id || 0;
|
|
89878
89932
|
if (nodeId < 0 || nodeId >= nodeLinks.length)
|
|
89879
89933
|
return 0;
|
|
89880
|
-
return ((
|
|
89934
|
+
return ((_a2 = nodeLinks[nodeId]) == null ? void 0 : _a2.flags) || 0;
|
|
89881
89935
|
}
|
|
89882
89936
|
function getEnumMemberValue(node) {
|
|
89883
89937
|
computeEnumMemberValues(node.parent);
|
|
@@ -89912,7 +89966,7 @@ function createTypeChecker(host) {
|
|
|
89912
89966
|
return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0;
|
|
89913
89967
|
}
|
|
89914
89968
|
function getTypeReferenceSerializationKind(typeNameIn, location) {
|
|
89915
|
-
var
|
|
89969
|
+
var _a2;
|
|
89916
89970
|
const typeName = getParseTreeNode(typeNameIn, isEntityName);
|
|
89917
89971
|
if (!typeName)
|
|
89918
89972
|
return 0 /* Unknown */;
|
|
@@ -89932,7 +89986,7 @@ function createTypeChecker(host) {
|
|
|
89932
89986
|
true,
|
|
89933
89987
|
location
|
|
89934
89988
|
);
|
|
89935
|
-
isTypeOnly = !!((
|
|
89989
|
+
isTypeOnly = !!((_a2 = rootValueSymbol == null ? void 0 : rootValueSymbol.declarations) == null ? void 0 : _a2.every(isTypeOnlyImportOrExportDeclaration));
|
|
89936
89990
|
}
|
|
89937
89991
|
const valueSymbol = resolveEntityName(
|
|
89938
89992
|
typeName,
|
|
@@ -90644,7 +90698,7 @@ function createTypeChecker(host) {
|
|
|
90644
90698
|
return externalHelpersModule;
|
|
90645
90699
|
}
|
|
90646
90700
|
function checkGrammarModifiers(node) {
|
|
90647
|
-
var
|
|
90701
|
+
var _a2;
|
|
90648
90702
|
const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node);
|
|
90649
90703
|
if (quickResult !== void 0) {
|
|
90650
90704
|
return quickResult;
|
|
@@ -90920,7 +90974,7 @@ function createTypeChecker(host) {
|
|
|
90920
90974
|
case 147 /* OutKeyword */: {
|
|
90921
90975
|
const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
|
|
90922
90976
|
const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
|
|
90923
|
-
const parent2 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((
|
|
90977
|
+
const parent2 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((_a2 = getJSDocRoot(node.parent)) == null ? void 0 : _a2.tags, isJSDocTypedefTag)) || node.parent;
|
|
90924
90978
|
if (node.kind !== 168 /* TypeParameter */ || parent2 && !(isInterfaceDeclaration(parent2) || isClassLike(parent2) || isTypeAliasDeclaration(parent2) || isJSDocTypedefTag(parent2))) {
|
|
90925
90979
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
|
|
90926
90980
|
}
|
|
@@ -91997,11 +92051,11 @@ function createTypeChecker(host) {
|
|
|
91997
92051
|
return ambientModulesCache;
|
|
91998
92052
|
}
|
|
91999
92053
|
function checkGrammarImportClause(node) {
|
|
92000
|
-
var
|
|
92054
|
+
var _a2;
|
|
92001
92055
|
if (node.isTypeOnly && node.name && node.namedBindings) {
|
|
92002
92056
|
return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
|
|
92003
92057
|
}
|
|
92004
|
-
if (node.isTypeOnly && ((
|
|
92058
|
+
if (node.isTypeOnly && ((_a2 = node.namedBindings) == null ? void 0 : _a2.kind) === 275 /* NamedImports */) {
|
|
92005
92059
|
return checkGrammarNamedImportsOrExports(node.namedBindings);
|
|
92006
92060
|
}
|
|
92007
92061
|
return false;
|
|
@@ -124095,6 +124149,13 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124095
124149
|
const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
|
|
124096
124150
|
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions;
|
|
124097
124151
|
let { oldProgram } = createProgramOptions;
|
|
124152
|
+
for (const option of commandLineOptionOfCustomType) {
|
|
124153
|
+
if (hasProperty(options, option.name)) {
|
|
124154
|
+
if (typeof options[option.name] === "string") {
|
|
124155
|
+
throw new Error(`${option.name} is a string value; tsconfig JSON must be parsed with parseJsonSourceFileConfigFileContent or getParsedCommandLineOfConfigFile before passing to createProgram`);
|
|
124156
|
+
}
|
|
124157
|
+
}
|
|
124158
|
+
}
|
|
124098
124159
|
const reportInvalidIgnoreDeprecations = memoize(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations));
|
|
124099
124160
|
let processingDefaultLibFiles;
|
|
124100
124161
|
let processingOtherFiles;
|
|
@@ -126874,8 +126935,9 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126874
126935
|
message = Diagnostics.File_is_library_specified_here;
|
|
126875
126936
|
break;
|
|
126876
126937
|
}
|
|
126877
|
-
const target =
|
|
126878
|
-
|
|
126938
|
+
const target = getEmitScriptTarget(options);
|
|
126939
|
+
const targetText = getNameOfScriptTarget(target);
|
|
126940
|
+
configFileNode = target === 2 /* ES2015 */ ? getOptionsSyntaxByValue("target", "es2015") ?? getOptionsSyntaxByValue("target", "es6") : targetText ? getOptionsSyntaxByValue("target", targetText) : void 0;
|
|
126879
126941
|
message = Diagnostics.File_is_default_library_for_target_specified_here;
|
|
126880
126942
|
break;
|
|
126881
126943
|
default:
|
|
@@ -145600,7 +145662,7 @@ function getSymbolForContextualType(node, checker) {
|
|
|
145600
145662
|
if (element) {
|
|
145601
145663
|
const contextualType = checker.getContextualTypeForObjectLiteralElement(element);
|
|
145602
145664
|
const symbol = contextualType == null ? void 0 : contextualType.getSymbol();
|
|
145603
|
-
if (symbol && !(getCheckFlags(symbol) & 6 /*
|
|
145665
|
+
if (symbol && !(getCheckFlags(symbol) & 6 /* SyntheticMember */)) {
|
|
145604
145666
|
return symbol;
|
|
145605
145667
|
}
|
|
145606
145668
|
}
|
|
@@ -170323,7 +170385,7 @@ var Core;
|
|
|
170323
170385
|
baseSymbol = void 0;
|
|
170324
170386
|
}
|
|
170325
170387
|
}
|
|
170326
|
-
return search.includes(baseSymbol || rootSymbol || sym) ? { symbol: rootSymbol && !(getCheckFlags(sym) & 6 /*
|
|
170388
|
+
return search.includes(baseSymbol || rootSymbol || sym) ? { symbol: rootSymbol && !(getCheckFlags(sym) & 6 /* SyntheticMember */) ? rootSymbol : sym, kind } : void 0;
|
|
170327
170389
|
},
|
|
170328
170390
|
/*allowBaseTypes*/
|
|
170329
170391
|
(rootSymbol) => !(search.parents && !search.parents.some((parent2) => explicitlyInheritsFrom(rootSymbol.parent, parent2, state.inheritsFromCache, checker)))
|
|
@@ -174148,7 +174210,7 @@ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeCheck
|
|
|
174148
174210
|
if (flags & 131072 /* Signature */)
|
|
174149
174211
|
return "index" /* indexSignatureElement */;
|
|
174150
174212
|
if (flags & 4 /* Property */) {
|
|
174151
|
-
if (flags & 33554432 /* Transient */ && symbol.links.checkFlags & 6 /*
|
|
174213
|
+
if (flags & 33554432 /* Transient */ && symbol.links.checkFlags & 6 /* SyntheticMember */) {
|
|
174152
174214
|
const unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), (rootSymbol) => {
|
|
174153
174215
|
const rootSymbolFlags = rootSymbol.getFlags();
|
|
174154
174216
|
if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) {
|
|
@@ -174176,6 +174238,8 @@ function getNormalizedSymbolModifiers(symbol) {
|
|
|
174176
174238
|
if (modifiers) {
|
|
174177
174239
|
return modifiers.split(",");
|
|
174178
174240
|
}
|
|
174241
|
+
} else if (symbol.flags & 64 /* Interface */) {
|
|
174242
|
+
return ["declare" /* ambientModifier */];
|
|
174179
174243
|
}
|
|
174180
174244
|
return [];
|
|
174181
174245
|
}
|
|
@@ -179080,6 +179144,7 @@ __export(ts_exports2, {
|
|
|
179080
179144
|
collectExternalModuleInfo: () => collectExternalModuleInfo,
|
|
179081
179145
|
combine: () => combine,
|
|
179082
179146
|
combinePaths: () => combinePaths,
|
|
179147
|
+
commandLineOptionOfCustomType: () => commandLineOptionOfCustomType,
|
|
179083
179148
|
commentPragmas: () => commentPragmas,
|
|
179084
179149
|
commonOptionsWithBuild: () => commonOptionsWithBuild,
|
|
179085
179150
|
commonPackageFolders: () => commonPackageFolders,
|
|
@@ -179696,6 +179761,8 @@ __export(ts_exports2, {
|
|
|
179696
179761
|
getNameOfDeclaration: () => getNameOfDeclaration,
|
|
179697
179762
|
getNameOfExpando: () => getNameOfExpando,
|
|
179698
179763
|
getNameOfJSDocTypedef: () => getNameOfJSDocTypedef,
|
|
179764
|
+
getNameOfModuleKind: () => getNameOfModuleKind,
|
|
179765
|
+
getNameOfModuleResolutionKind: () => getNameOfModuleResolutionKind,
|
|
179699
179766
|
getNameOfScriptTarget: () => getNameOfScriptTarget,
|
|
179700
179767
|
getNameOrArgument: () => getNameOrArgument,
|
|
179701
179768
|
getNameTable: () => getNameTable,
|
|
@@ -180704,6 +180771,7 @@ __export(ts_exports2, {
|
|
|
180704
180771
|
moduleOptionDeclaration: () => moduleOptionDeclaration,
|
|
180705
180772
|
moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo,
|
|
180706
180773
|
moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter,
|
|
180774
|
+
moduleResolutionOptionDeclaration: () => moduleResolutionOptionDeclaration,
|
|
180707
180775
|
moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations,
|
|
180708
180776
|
moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports,
|
|
180709
180777
|
moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
|
|
@@ -193508,6 +193576,7 @@ if (typeof console !== "undefined") {
|
|
|
193508
193576
|
collectExternalModuleInfo,
|
|
193509
193577
|
combine,
|
|
193510
193578
|
combinePaths,
|
|
193579
|
+
commandLineOptionOfCustomType,
|
|
193511
193580
|
commentPragmas,
|
|
193512
193581
|
commonOptionsWithBuild,
|
|
193513
193582
|
commonPackageFolders,
|
|
@@ -194124,6 +194193,8 @@ if (typeof console !== "undefined") {
|
|
|
194124
194193
|
getNameOfDeclaration,
|
|
194125
194194
|
getNameOfExpando,
|
|
194126
194195
|
getNameOfJSDocTypedef,
|
|
194196
|
+
getNameOfModuleKind,
|
|
194197
|
+
getNameOfModuleResolutionKind,
|
|
194127
194198
|
getNameOfScriptTarget,
|
|
194128
194199
|
getNameOrArgument,
|
|
194129
194200
|
getNameTable,
|
|
@@ -195132,6 +195203,7 @@ if (typeof console !== "undefined") {
|
|
|
195132
195203
|
moduleOptionDeclaration,
|
|
195133
195204
|
moduleResolutionIsEqualTo,
|
|
195134
195205
|
moduleResolutionNameAndModeGetter,
|
|
195206
|
+
moduleResolutionOptionDeclaration,
|
|
195135
195207
|
moduleResolutionOptionDeclarations,
|
|
195136
195208
|
moduleResolutionSupportsPackageJsonExportsAndImports,
|
|
195137
195209
|
moduleResolutionUsesNodeModules,
|