@typescript-deploys/pr-build 5.5.0-pr-58396-2 → 5.5.0-pr-58404-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 +316 -362
- package/lib/typescript.js +330 -379
- package/package.json +1 -1
package/lib/typescript.js
CHANGED
|
@@ -99,6 +99,7 @@ __export(typescript_exports, {
|
|
|
99
99
|
InlayHints: () => ts_InlayHints_exports,
|
|
100
100
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
101
101
|
InternalSymbolName: () => InternalSymbolName,
|
|
102
|
+
IntersectionFlags: () => IntersectionFlags,
|
|
102
103
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
103
104
|
JSDocParsingMode: () => JSDocParsingMode,
|
|
104
105
|
JsDoc: () => ts_JsDoc_exports,
|
|
@@ -919,8 +920,6 @@ __export(typescript_exports, {
|
|
|
919
920
|
getNameOfDeclaration: () => getNameOfDeclaration,
|
|
920
921
|
getNameOfExpando: () => getNameOfExpando,
|
|
921
922
|
getNameOfJSDocTypedef: () => getNameOfJSDocTypedef,
|
|
922
|
-
getNameOfModuleKind: () => getNameOfModuleKind,
|
|
923
|
-
getNameOfModuleResolutionKind: () => getNameOfModuleResolutionKind,
|
|
924
923
|
getNameOfScriptTarget: () => getNameOfScriptTarget,
|
|
925
924
|
getNameOrArgument: () => getNameOrArgument,
|
|
926
925
|
getNameTable: () => getNameTable,
|
|
@@ -1929,7 +1928,6 @@ __export(typescript_exports, {
|
|
|
1929
1928
|
moduleOptionDeclaration: () => moduleOptionDeclaration,
|
|
1930
1929
|
moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo,
|
|
1931
1930
|
moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter,
|
|
1932
|
-
moduleResolutionOptionDeclaration: () => moduleResolutionOptionDeclaration,
|
|
1933
1931
|
moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations,
|
|
1934
1932
|
moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports,
|
|
1935
1933
|
moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
|
|
@@ -2366,7 +2364,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2366
2364
|
|
|
2367
2365
|
// src/compiler/corePublic.ts
|
|
2368
2366
|
var versionMajorMinor = "5.5";
|
|
2369
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2367
|
+
var version = `${versionMajorMinor}.0-insiders.20240503`;
|
|
2370
2368
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2371
2369
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2372
2370
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6393,6 +6391,12 @@ var UnionReduction = /* @__PURE__ */ ((UnionReduction2) => {
|
|
|
6393
6391
|
UnionReduction2[UnionReduction2["Subtype"] = 2] = "Subtype";
|
|
6394
6392
|
return UnionReduction2;
|
|
6395
6393
|
})(UnionReduction || {});
|
|
6394
|
+
var IntersectionFlags = /* @__PURE__ */ ((IntersectionFlags2) => {
|
|
6395
|
+
IntersectionFlags2[IntersectionFlags2["None"] = 0] = "None";
|
|
6396
|
+
IntersectionFlags2[IntersectionFlags2["NoSupertypeReduction"] = 1] = "NoSupertypeReduction";
|
|
6397
|
+
IntersectionFlags2[IntersectionFlags2["NoConstraintReduction"] = 2] = "NoConstraintReduction";
|
|
6398
|
+
return IntersectionFlags2;
|
|
6399
|
+
})(IntersectionFlags || {});
|
|
6396
6400
|
var ContextFlags = /* @__PURE__ */ ((ContextFlags3) => {
|
|
6397
6401
|
ContextFlags3[ContextFlags3["None"] = 0] = "None";
|
|
6398
6402
|
ContextFlags3[ContextFlags3["Signature"] = 1] = "Signature";
|
|
@@ -6604,8 +6608,7 @@ var CheckFlags = /* @__PURE__ */ ((CheckFlags2) => {
|
|
|
6604
6608
|
CheckFlags2[CheckFlags2["Mapped"] = 262144] = "Mapped";
|
|
6605
6609
|
CheckFlags2[CheckFlags2["StripOptional"] = 524288] = "StripOptional";
|
|
6606
6610
|
CheckFlags2[CheckFlags2["Unresolved"] = 1048576] = "Unresolved";
|
|
6607
|
-
CheckFlags2[CheckFlags2["
|
|
6608
|
-
CheckFlags2[CheckFlags2["SyntheticMember"] = 6] = "SyntheticMember";
|
|
6611
|
+
CheckFlags2[CheckFlags2["Synthetic"] = 6] = "Synthetic";
|
|
6609
6612
|
CheckFlags2[CheckFlags2["Discriminant"] = 192] = "Discriminant";
|
|
6610
6613
|
CheckFlags2[CheckFlags2["Partial"] = 48] = "Partial";
|
|
6611
6614
|
return CheckFlags2;
|
|
@@ -21209,7 +21212,7 @@ function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
|
21209
21212
|
const flags = getCombinedModifierFlags(declaration);
|
|
21210
21213
|
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~7 /* AccessibilityModifier */;
|
|
21211
21214
|
}
|
|
21212
|
-
if (getCheckFlags(s) & 6 /*
|
|
21215
|
+
if (getCheckFlags(s) & 6 /* Synthetic */) {
|
|
21213
21216
|
const checkFlags = s.links.checkFlags;
|
|
21214
21217
|
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 2 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 1 /* Public */ : 4 /* Protected */;
|
|
21215
21218
|
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 256 /* Static */ : 0;
|
|
@@ -22084,19 +22087,7 @@ function getStrictOptionValue(compilerOptions, flag) {
|
|
|
22084
22087
|
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
22085
22088
|
}
|
|
22086
22089
|
function getNameOfScriptTarget(scriptTarget) {
|
|
22087
|
-
|
|
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);
|
|
22090
|
+
return forEachEntry(targetOptionDeclaration.type, (value, key) => value === scriptTarget ? key : void 0);
|
|
22100
22091
|
}
|
|
22101
22092
|
function getEmitStandardClassFields(compilerOptions) {
|
|
22102
22093
|
return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
|
|
@@ -40433,25 +40424,6 @@ var moduleOptionDeclaration = {
|
|
|
40433
40424
|
description: Diagnostics.Specify_what_module_code_is_generated,
|
|
40434
40425
|
defaultValueDescription: void 0
|
|
40435
40426
|
};
|
|
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
|
-
};
|
|
40455
40427
|
var commandOptionsWithoutBuild = [
|
|
40456
40428
|
// CommandLine only options
|
|
40457
40429
|
{
|
|
@@ -40893,7 +40865,25 @@ var commandOptionsWithoutBuild = [
|
|
|
40893
40865
|
defaultValueDescription: false
|
|
40894
40866
|
},
|
|
40895
40867
|
// Module Resolution
|
|
40896
|
-
|
|
40868
|
+
{
|
|
40869
|
+
name: "moduleResolution",
|
|
40870
|
+
type: new Map(Object.entries({
|
|
40871
|
+
// N.B. The first entry specifies the value shown in `tsc --init`
|
|
40872
|
+
node10: 2 /* Node10 */,
|
|
40873
|
+
node: 2 /* Node10 */,
|
|
40874
|
+
classic: 1 /* Classic */,
|
|
40875
|
+
node16: 3 /* Node16 */,
|
|
40876
|
+
nodenext: 99 /* NodeNext */,
|
|
40877
|
+
bundler: 100 /* Bundler */
|
|
40878
|
+
})),
|
|
40879
|
+
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
40880
|
+
affectsSourceFile: true,
|
|
40881
|
+
affectsModuleResolution: true,
|
|
40882
|
+
paramType: Diagnostics.STRATEGY,
|
|
40883
|
+
category: Diagnostics.Modules,
|
|
40884
|
+
description: Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,
|
|
40885
|
+
defaultValueDescription: Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node
|
|
40886
|
+
},
|
|
40897
40887
|
{
|
|
40898
40888
|
name: "baseUrl",
|
|
40899
40889
|
type: "string",
|
|
@@ -50265,7 +50255,6 @@ function isInstantiatedModule(node, preserveConstEnums) {
|
|
|
50265
50255
|
return moduleState === 1 /* Instantiated */ || preserveConstEnums && moduleState === 2 /* ConstEnumOnly */;
|
|
50266
50256
|
}
|
|
50267
50257
|
function createTypeChecker(host) {
|
|
50268
|
-
var _a;
|
|
50269
50258
|
var deferredDiagnosticsCallbacks = [];
|
|
50270
50259
|
var addLazyDiagnostic = (arg) => {
|
|
50271
50260
|
deferredDiagnosticsCallbacks.push(arg);
|
|
@@ -50292,7 +50281,6 @@ function createTypeChecker(host) {
|
|
|
50292
50281
|
var compilerOptions = host.getCompilerOptions();
|
|
50293
50282
|
var languageVersion = getEmitScriptTarget(compilerOptions);
|
|
50294
50283
|
var moduleKind = getEmitModuleKind(compilerOptions);
|
|
50295
|
-
var moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
50296
50284
|
var legacyDecorators = !!compilerOptions.experimentalDecorators;
|
|
50297
50285
|
var useDefineForClassFields = getUseDefineForClassFields(compilerOptions);
|
|
50298
50286
|
var emitStandardClassFields = getEmitStandardClassFields(compilerOptions);
|
|
@@ -50305,7 +50293,6 @@ function createTypeChecker(host) {
|
|
|
50305
50293
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
50306
50294
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
50307
50295
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
50308
|
-
var noUncheckedIndexedAccess = compilerOptions.noUncheckedIndexedAccess;
|
|
50309
50296
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
50310
50297
|
var emitResolver = createResolver();
|
|
50311
50298
|
var nodeBuilder = createNodeBuilder();
|
|
@@ -51273,32 +51260,6 @@ function createTypeChecker(host) {
|
|
|
51273
51260
|
[".jsx", ".jsx"],
|
|
51274
51261
|
[".json", ".json"]
|
|
51275
51262
|
];
|
|
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);
|
|
51302
51263
|
initializeTypeChecker();
|
|
51303
51264
|
return checker;
|
|
51304
51265
|
function getCachedType(key) {
|
|
@@ -51473,8 +51434,8 @@ function createTypeChecker(host) {
|
|
|
51473
51434
|
symbol.links.type = type;
|
|
51474
51435
|
return symbol;
|
|
51475
51436
|
}
|
|
51476
|
-
function createProperty(name, type
|
|
51477
|
-
const symbol = createSymbol(4 /* Property */, name
|
|
51437
|
+
function createProperty(name, type) {
|
|
51438
|
+
const symbol = createSymbol(4 /* Property */, name);
|
|
51478
51439
|
symbol.links.type = type;
|
|
51479
51440
|
return symbol;
|
|
51480
51441
|
}
|
|
@@ -51656,9 +51617,9 @@ function createTypeChecker(host) {
|
|
|
51656
51617
|
});
|
|
51657
51618
|
}
|
|
51658
51619
|
function mergeModuleAugmentation(moduleName) {
|
|
51659
|
-
var
|
|
51620
|
+
var _a, _b, _c;
|
|
51660
51621
|
const moduleAugmentation = moduleName.parent;
|
|
51661
|
-
if (((
|
|
51622
|
+
if (((_a = moduleAugmentation.symbol.declarations) == null ? void 0 : _a[0]) !== moduleAugmentation) {
|
|
51662
51623
|
Debug.assert(moduleAugmentation.symbol.declarations.length > 1);
|
|
51663
51624
|
return;
|
|
51664
51625
|
}
|
|
@@ -51971,7 +51932,7 @@ function createTypeChecker(host) {
|
|
|
51971
51932
|
}
|
|
51972
51933
|
function onSuccessfullyResolvedSymbol(errorLocation, result, meaning, lastLocation, associatedDeclarationForContainingInitializerOrBindingName, withinDeferredContext) {
|
|
51973
51934
|
addLazyDiagnostic(() => {
|
|
51974
|
-
var
|
|
51935
|
+
var _a;
|
|
51975
51936
|
const name = result.escapedName;
|
|
51976
51937
|
const isInExternalModule = lastLocation && isSourceFile(lastLocation) && isExternalOrCommonJsModule(lastLocation);
|
|
51977
51938
|
if (errorLocation && (meaning & 2 /* BlockScopedVariable */ || (meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 111551 /* Value */) === 111551 /* Value */)) {
|
|
@@ -52011,7 +51972,7 @@ function createTypeChecker(host) {
|
|
|
52011
51972
|
const isGlobal = getSymbol2(globals, name, meaning) === result;
|
|
52012
51973
|
const nonValueSymbol = isGlobal && isSourceFile(lastLocation) && lastLocation.locals && getSymbol2(lastLocation.locals, name, ~111551 /* Value */);
|
|
52013
51974
|
if (nonValueSymbol) {
|
|
52014
|
-
const importDecl = (
|
|
51975
|
+
const importDecl = (_a = nonValueSymbol.declarations) == null ? void 0 : _a.find((d) => d.kind === 276 /* ImportSpecifier */ || d.kind === 273 /* ImportClause */ || d.kind === 274 /* NamespaceImport */ || d.kind === 271 /* ImportEqualsDeclaration */);
|
|
52015
51976
|
if (importDecl && !isTypeOnlyImportDeclaration(importDecl)) {
|
|
52016
51977
|
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));
|
|
52017
51978
|
}
|
|
@@ -52262,12 +52223,12 @@ function createTypeChecker(host) {
|
|
|
52262
52223
|
return false;
|
|
52263
52224
|
}
|
|
52264
52225
|
function checkResolvedBlockScopedVariable(result, errorLocation) {
|
|
52265
|
-
var
|
|
52226
|
+
var _a;
|
|
52266
52227
|
Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */));
|
|
52267
52228
|
if (result.flags & (16 /* Function */ | 1 /* FunctionScopedVariable */ | 67108864 /* Assignment */) && result.flags & 32 /* Class */) {
|
|
52268
52229
|
return;
|
|
52269
52230
|
}
|
|
52270
|
-
const declaration = (
|
|
52231
|
+
const declaration = (_a = result.declarations) == null ? void 0 : _a.find(
|
|
52271
52232
|
(d) => isBlockOrCatchScoped(d) || isClassLike(d) || d.kind === 266 /* EnumDeclaration */
|
|
52272
52233
|
);
|
|
52273
52234
|
if (declaration === void 0)
|
|
@@ -52449,14 +52410,14 @@ function createTypeChecker(host) {
|
|
|
52449
52410
|
}
|
|
52450
52411
|
}
|
|
52451
52412
|
function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) {
|
|
52452
|
-
var
|
|
52413
|
+
var _a;
|
|
52453
52414
|
let exportDefaultSymbol;
|
|
52454
52415
|
if (isShorthandAmbientModuleSymbol(moduleSymbol)) {
|
|
52455
52416
|
exportDefaultSymbol = moduleSymbol;
|
|
52456
52417
|
} else {
|
|
52457
52418
|
exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
|
|
52458
52419
|
}
|
|
52459
|
-
const file = (
|
|
52420
|
+
const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
52460
52421
|
const specifier = getModuleSpecifierForImportOrExport(node);
|
|
52461
52422
|
if (!specifier) {
|
|
52462
52423
|
return exportDefaultSymbol;
|
|
@@ -52522,8 +52483,8 @@ function createTypeChecker(host) {
|
|
|
52522
52483
|
}
|
|
52523
52484
|
}
|
|
52524
52485
|
function reportNonDefaultExport(moduleSymbol, node) {
|
|
52525
|
-
var
|
|
52526
|
-
if ((
|
|
52486
|
+
var _a, _b, _c;
|
|
52487
|
+
if ((_a = moduleSymbol.exports) == null ? void 0 : _a.has(node.symbol.escapedName)) {
|
|
52527
52488
|
error2(
|
|
52528
52489
|
node.name,
|
|
52529
52490
|
Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,
|
|
@@ -52536,8 +52497,8 @@ function createTypeChecker(host) {
|
|
|
52536
52497
|
if (exportStar) {
|
|
52537
52498
|
const defaultExport = (_c = exportStar.declarations) == null ? void 0 : _c.find(
|
|
52538
52499
|
(decl) => {
|
|
52539
|
-
var
|
|
52540
|
-
return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (
|
|
52500
|
+
var _a2, _b2;
|
|
52501
|
+
return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (_a2 = resolveExternalModuleName(decl, decl.moduleSpecifier)) == null ? void 0 : _a2.exports) == null ? void 0 : _b2.has("default" /* Default */)));
|
|
52541
52502
|
}
|
|
52542
52503
|
);
|
|
52543
52504
|
if (defaultExport) {
|
|
@@ -52604,11 +52565,11 @@ function createTypeChecker(host) {
|
|
|
52604
52565
|
return result;
|
|
52605
52566
|
}
|
|
52606
52567
|
function getExportOfModule(symbol, name, specifier, dontResolveAlias) {
|
|
52607
|
-
var
|
|
52568
|
+
var _a;
|
|
52608
52569
|
if (symbol.flags & 1536 /* Module */) {
|
|
52609
52570
|
const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText);
|
|
52610
52571
|
const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
|
|
52611
|
-
const exportStarDeclaration = (
|
|
52572
|
+
const exportStarDeclaration = (_a = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a.get(name.escapedText);
|
|
52612
52573
|
markSymbolOfAliasDeclarationIfTypeOnly(
|
|
52613
52574
|
specifier,
|
|
52614
52575
|
exportSymbol,
|
|
@@ -52630,7 +52591,7 @@ function createTypeChecker(host) {
|
|
|
52630
52591
|
}
|
|
52631
52592
|
}
|
|
52632
52593
|
function getExternalModuleMember(node, specifier, dontResolveAlias = false) {
|
|
52633
|
-
var
|
|
52594
|
+
var _a;
|
|
52634
52595
|
const moduleSpecifier = getExternalModuleRequireArgument(node) || node.moduleSpecifier;
|
|
52635
52596
|
const moduleSymbol = resolveExternalModuleName(node, moduleSpecifier);
|
|
52636
52597
|
const name = !isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name;
|
|
@@ -52664,7 +52625,7 @@ function createTypeChecker(host) {
|
|
|
52664
52625
|
symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias);
|
|
52665
52626
|
let symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);
|
|
52666
52627
|
if (symbolFromModule === void 0 && name.escapedText === "default" /* Default */) {
|
|
52667
|
-
const file = (
|
|
52628
|
+
const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
52668
52629
|
if (isOnlyImportableAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
52669
52630
|
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
52670
52631
|
}
|
|
@@ -52678,7 +52639,7 @@ function createTypeChecker(host) {
|
|
|
52678
52639
|
}
|
|
52679
52640
|
}
|
|
52680
52641
|
function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name) {
|
|
52681
|
-
var
|
|
52642
|
+
var _a;
|
|
52682
52643
|
const moduleName = getFullyQualifiedName(moduleSymbol, node);
|
|
52683
52644
|
const declarationName = declarationNameToString(name);
|
|
52684
52645
|
const suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
@@ -52689,7 +52650,7 @@ function createTypeChecker(host) {
|
|
|
52689
52650
|
addRelatedInfo(diagnostic, createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName));
|
|
52690
52651
|
}
|
|
52691
52652
|
} else {
|
|
52692
|
-
if ((
|
|
52653
|
+
if ((_a = moduleSymbol.exports) == null ? void 0 : _a.has("default" /* Default */)) {
|
|
52693
52654
|
error2(
|
|
52694
52655
|
name,
|
|
52695
52656
|
Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,
|
|
@@ -52702,8 +52663,8 @@ function createTypeChecker(host) {
|
|
|
52702
52663
|
}
|
|
52703
52664
|
}
|
|
52704
52665
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
52705
|
-
var
|
|
52706
|
-
const localSymbol = (_b = (
|
|
52666
|
+
var _a, _b;
|
|
52667
|
+
const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(name.escapedText);
|
|
52707
52668
|
const exports2 = moduleSymbol.exports;
|
|
52708
52669
|
if (localSymbol) {
|
|
52709
52670
|
const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */);
|
|
@@ -52970,9 +52931,9 @@ function createTypeChecker(host) {
|
|
|
52970
52931
|
return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty);
|
|
52971
52932
|
}
|
|
52972
52933
|
function markSymbolOfAliasDeclarationIfTypeOnlyWorker(aliasDeclarationLinks, target, overwriteEmpty) {
|
|
52973
|
-
var
|
|
52934
|
+
var _a;
|
|
52974
52935
|
if (target && (aliasDeclarationLinks.typeOnlyDeclaration === void 0 || overwriteEmpty && aliasDeclarationLinks.typeOnlyDeclaration === false)) {
|
|
52975
|
-
const exportSymbol = ((
|
|
52936
|
+
const exportSymbol = ((_a = target.exports) == null ? void 0 : _a.get("export=" /* ExportEquals */)) ?? target;
|
|
52976
52937
|
const typeOnly = exportSymbol.declarations && find(exportSymbol.declarations, isTypeOnlyImportOrExportDeclaration);
|
|
52977
52938
|
aliasDeclarationLinks.typeOnlyDeclaration = typeOnly ?? getSymbolLinks(exportSymbol).typeOnlyDeclaration ?? false;
|
|
52978
52939
|
}
|
|
@@ -53269,7 +53230,7 @@ function createTypeChecker(host) {
|
|
|
53269
53230
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
53270
53231
|
}
|
|
53271
53232
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
53272
|
-
var
|
|
53233
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
53273
53234
|
if (startsWith(moduleReference, "@types/")) {
|
|
53274
53235
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
53275
53236
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -53284,13 +53245,13 @@ function createTypeChecker(host) {
|
|
|
53284
53245
|
return ambientModule;
|
|
53285
53246
|
}
|
|
53286
53247
|
const currentSourceFile = getSourceFileOfNode(location);
|
|
53287
|
-
const contextSpecifier = isStringLiteralLike(location) ? location : ((
|
|
53248
|
+
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.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(
|
|
53288
53249
|
location.initializer,
|
|
53289
53250
|
/*requireStringLiteralLikeArgument*/
|
|
53290
53251
|
true
|
|
53291
53252
|
) ? 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);
|
|
53292
53253
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
|
|
53293
|
-
const
|
|
53254
|
+
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
53294
53255
|
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
53295
53256
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
53296
53257
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
@@ -53326,7 +53287,7 @@ function createTypeChecker(host) {
|
|
|
53326
53287
|
moduleReference
|
|
53327
53288
|
);
|
|
53328
53289
|
}
|
|
53329
|
-
if (
|
|
53290
|
+
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
53330
53291
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
53331
53292
|
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
53332
53293
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
@@ -53430,8 +53391,8 @@ function createTypeChecker(host) {
|
|
|
53430
53391
|
error2(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
53431
53392
|
} else {
|
|
53432
53393
|
const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference);
|
|
53433
|
-
const resolutionIsNode16OrNext =
|
|
53434
|
-
if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) &&
|
|
53394
|
+
const resolutionIsNode16OrNext = moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */;
|
|
53395
|
+
if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) {
|
|
53435
53396
|
error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
53436
53397
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
53437
53398
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
@@ -53517,7 +53478,7 @@ function createTypeChecker(host) {
|
|
|
53517
53478
|
return links.cjsExportMerged = merged;
|
|
53518
53479
|
}
|
|
53519
53480
|
function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) {
|
|
53520
|
-
var
|
|
53481
|
+
var _a;
|
|
53521
53482
|
const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
|
|
53522
53483
|
if (!dontResolveAlias && symbol) {
|
|
53523
53484
|
if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 307 /* SourceFile */)) {
|
|
@@ -53533,7 +53494,7 @@ function createTypeChecker(host) {
|
|
|
53533
53494
|
if (defaultOnlyType) {
|
|
53534
53495
|
return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent);
|
|
53535
53496
|
}
|
|
53536
|
-
const targetFile = (
|
|
53497
|
+
const targetFile = (_a = moduleSymbol == null ? void 0 : moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
53537
53498
|
const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(getEmitSyntaxForModuleSpecifierExpression(reference), host.getImpliedNodeFormatForEmit(targetFile));
|
|
53538
53499
|
if (getESModuleInterop(compilerOptions) || isEsmCjsRef) {
|
|
53539
53500
|
let sigs = getSignaturesOfStructuredType(type, 0 /* Call */);
|
|
@@ -53742,8 +53703,8 @@ function createTypeChecker(host) {
|
|
|
53742
53703
|
return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent));
|
|
53743
53704
|
}
|
|
53744
53705
|
function getFunctionExpressionParentSymbolOrSymbol(symbol) {
|
|
53745
|
-
var
|
|
53746
|
-
return ((
|
|
53706
|
+
var _a, _b;
|
|
53707
|
+
return ((_a = symbol.valueDeclaration) == null ? void 0 : _a.kind) === 219 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 218 /* FunctionExpression */ ? getSymbolOfNode(symbol.valueDeclaration.parent) || symbol : symbol;
|
|
53747
53708
|
}
|
|
53748
53709
|
function getAlternativeContainingModules(symbol, enclosingDeclaration) {
|
|
53749
53710
|
const containingFile = getSourceFileOfNode(enclosingDeclaration);
|
|
@@ -53897,11 +53858,11 @@ function createTypeChecker(host) {
|
|
|
53897
53858
|
return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getSymbolFlags(symbol, !includeTypeOnlyMembers) & 111551 /* Value */);
|
|
53898
53859
|
}
|
|
53899
53860
|
function createType(flags) {
|
|
53900
|
-
var
|
|
53861
|
+
var _a;
|
|
53901
53862
|
const result = new Type29(checker, flags);
|
|
53902
53863
|
typeCount++;
|
|
53903
53864
|
result.id = typeCount;
|
|
53904
|
-
(
|
|
53865
|
+
(_a = tracing) == null ? void 0 : _a.recordType(result);
|
|
53905
53866
|
return result;
|
|
53906
53867
|
}
|
|
53907
53868
|
function createTypeWithSymbol(flags, symbol) {
|
|
@@ -54320,7 +54281,7 @@ function createTypeChecker(host) {
|
|
|
54320
54281
|
}
|
|
54321
54282
|
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible };
|
|
54322
54283
|
function getIsDeclarationVisible(declaration) {
|
|
54323
|
-
var
|
|
54284
|
+
var _a, _b;
|
|
54324
54285
|
if (!isDeclarationVisible(declaration)) {
|
|
54325
54286
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
54326
54287
|
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
@@ -54332,7 +54293,7 @@ function createTypeChecker(host) {
|
|
|
54332
54293
|
} else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration, 32 /* Export */) && isDeclarationVisible(declaration.parent)) {
|
|
54333
54294
|
return addVisibleAlias(declaration, declaration);
|
|
54334
54295
|
} else if (isBindingElement(declaration)) {
|
|
54335
|
-
if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((
|
|
54296
|
+
if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a = declaration.parent) == null ? void 0 : _a.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)) {
|
|
54336
54297
|
return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
|
|
54337
54298
|
} else if (symbol.flags & 2 /* BlockScopedVariable */) {
|
|
54338
54299
|
const variableStatement = findAncestor(declaration, isVariableStatement);
|
|
@@ -54651,7 +54612,7 @@ function createTypeChecker(host) {
|
|
|
54651
54612
|
return typeNode;
|
|
54652
54613
|
}
|
|
54653
54614
|
function typeToTypeNodeWorker(type, context) {
|
|
54654
|
-
var
|
|
54615
|
+
var _a, _b;
|
|
54655
54616
|
if (cancellationToken && cancellationToken.throwIfCancellationRequested) {
|
|
54656
54617
|
cancellationToken.throwIfCancellationRequested();
|
|
54657
54618
|
}
|
|
@@ -54785,7 +54746,7 @@ function createTypeChecker(host) {
|
|
|
54785
54746
|
if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) {
|
|
54786
54747
|
context.encounteredError = true;
|
|
54787
54748
|
}
|
|
54788
|
-
(_b = (
|
|
54749
|
+
(_b = (_a = context.tracker).reportInaccessibleThisError) == null ? void 0 : _b.call(_a);
|
|
54789
54750
|
}
|
|
54790
54751
|
context.approximateLength += 4;
|
|
54791
54752
|
return factory.createThisTypeNode();
|
|
@@ -54950,9 +54911,9 @@ function createTypeChecker(host) {
|
|
|
54950
54911
|
return factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
|
|
54951
54912
|
}
|
|
54952
54913
|
function typeToTypeNodeOrCircularityElision(type2) {
|
|
54953
|
-
var
|
|
54914
|
+
var _a2, _b2, _c;
|
|
54954
54915
|
if (type2.flags & 1048576 /* Union */) {
|
|
54955
|
-
if ((
|
|
54916
|
+
if ((_a2 = context.visitedTypes) == null ? void 0 : _a2.has(getTypeId(type2))) {
|
|
54956
54917
|
if (!(context.flags & 131072 /* AllowAnonymousIdentifier */)) {
|
|
54957
54918
|
context.encounteredError = true;
|
|
54958
54919
|
(_c = (_b2 = context.tracker) == null ? void 0 : _b2.reportCyclicStructureError) == null ? void 0 : _c.call(_b2);
|
|
@@ -54970,13 +54931,13 @@ function createTypeChecker(host) {
|
|
|
54970
54931
|
return !!type2.target && isMappedTypeHomomorphic(type2.target) && !isMappedTypeHomomorphic(type2);
|
|
54971
54932
|
}
|
|
54972
54933
|
function createMappedTypeNodeFromType(type2) {
|
|
54973
|
-
var
|
|
54934
|
+
var _a2;
|
|
54974
54935
|
Debug.assert(!!(type2.flags & 524288 /* Object */));
|
|
54975
54936
|
const readonlyToken = type2.declaration.readonlyToken ? factory.createToken(type2.declaration.readonlyToken.kind) : void 0;
|
|
54976
54937
|
const questionToken = type2.declaration.questionToken ? factory.createToken(type2.declaration.questionToken.kind) : void 0;
|
|
54977
54938
|
let appropriateConstraintTypeNode;
|
|
54978
54939
|
let newTypeVariable;
|
|
54979
|
-
const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type2) && !(getModifiersTypeFromMappedType(type2).flags & 2 /* Unknown */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && !(getConstraintTypeFromMappedType(type2).flags & 262144 /* TypeParameter */ && ((
|
|
54940
|
+
const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type2) && !(getModifiersTypeFromMappedType(type2).flags & 2 /* Unknown */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && !(getConstraintTypeFromMappedType(type2).flags & 262144 /* TypeParameter */ && ((_a2 = getConstraintOfTypeParameter(getConstraintTypeFromMappedType(type2))) == null ? void 0 : _a2.flags) & 4194304 /* Index */);
|
|
54980
54941
|
if (isMappedTypeWithKeyofConstraintDeclaration(type2)) {
|
|
54981
54942
|
if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type2) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
54982
54943
|
const newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T"));
|
|
@@ -55035,7 +54996,7 @@ function createTypeChecker(host) {
|
|
|
55035
54996
|
return result;
|
|
55036
54997
|
}
|
|
55037
54998
|
function createAnonymousTypeNode(type2) {
|
|
55038
|
-
var
|
|
54999
|
+
var _a2, _b2;
|
|
55039
55000
|
const typeId = type2.id;
|
|
55040
55001
|
const symbol = type2.symbol;
|
|
55041
55002
|
if (symbol) {
|
|
@@ -55049,7 +55010,7 @@ function createTypeChecker(host) {
|
|
|
55049
55010
|
return typeNode;
|
|
55050
55011
|
}
|
|
55051
55012
|
}
|
|
55052
|
-
if ((
|
|
55013
|
+
if ((_a2 = context.visitedTypes) == null ? void 0 : _a2.has(typeId)) {
|
|
55053
55014
|
return createElidedInformationPlaceholder(context);
|
|
55054
55015
|
}
|
|
55055
55016
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
@@ -55079,19 +55040,19 @@ function createTypeChecker(host) {
|
|
|
55079
55040
|
return createTypeNodeFromObjectType(type2);
|
|
55080
55041
|
}
|
|
55081
55042
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
55082
|
-
var
|
|
55043
|
+
var _a3;
|
|
55083
55044
|
const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method
|
|
55084
55045
|
some(symbol.declarations, (declaration) => isStatic(declaration));
|
|
55085
55046
|
const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
|
|
55086
55047
|
forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */));
|
|
55087
55048
|
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
|
|
55088
|
-
return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((
|
|
55049
|
+
return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(typeId))) && // it is type of the symbol uses itself recursively
|
|
55089
55050
|
(!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
|
|
55090
55051
|
}
|
|
55091
55052
|
}
|
|
55092
55053
|
}
|
|
55093
55054
|
function visitAndTransformType(type2, transform2) {
|
|
55094
|
-
var
|
|
55055
|
+
var _a2, _b2, _c;
|
|
55095
55056
|
const typeId = type2.id;
|
|
55096
55057
|
const isConstructorObject = getObjectFlags(type2) & 16 /* Anonymous */ && type2.symbol && type2.symbol.flags & 32 /* Class */;
|
|
55097
55058
|
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;
|
|
@@ -55106,7 +55067,7 @@ function createTypeChecker(host) {
|
|
|
55106
55067
|
if (links) {
|
|
55107
55068
|
links.serializedTypes || (links.serializedTypes = /* @__PURE__ */ new Map());
|
|
55108
55069
|
}
|
|
55109
|
-
const cachedResult = (
|
|
55070
|
+
const cachedResult = (_a2 = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _a2.get(key);
|
|
55110
55071
|
if (cachedResult) {
|
|
55111
55072
|
(_b2 = cachedResult.trackedSymbols) == null ? void 0 : _b2.forEach(
|
|
55112
55073
|
([symbol, enclosingDeclaration, meaning]) => context.tracker.trackSymbol(
|
|
@@ -55425,11 +55386,11 @@ function createTypeChecker(host) {
|
|
|
55425
55386
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
55426
55387
|
}
|
|
55427
55388
|
function shouldUsePlaceholderForProperty(propertySymbol, context) {
|
|
55428
|
-
var
|
|
55429
|
-
return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((
|
|
55389
|
+
var _a;
|
|
55390
|
+
return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((_a = context.reverseMappedStack) == null ? void 0 : _a[0]) && !(getObjectFlags(last(context.reverseMappedStack).links.propertyType) & 16 /* Anonymous */));
|
|
55430
55391
|
}
|
|
55431
55392
|
function addPropertyToElementList(propertySymbol, context, typeElements) {
|
|
55432
|
-
var
|
|
55393
|
+
var _a;
|
|
55433
55394
|
const propertyIsReverseMapped = !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */);
|
|
55434
55395
|
const propertyType = shouldUsePlaceholderForProperty(propertySymbol, context) ? anyType : getNonMissingTypeOfSymbol(propertySymbol);
|
|
55435
55396
|
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
@@ -55451,7 +55412,7 @@ function createTypeChecker(host) {
|
|
|
55451
55412
|
context.tracker.reportNonSerializableProperty(symbolToString(propertySymbol));
|
|
55452
55413
|
}
|
|
55453
55414
|
}
|
|
55454
|
-
context.enclosingDeclaration = propertySymbol.valueDeclaration || ((
|
|
55415
|
+
context.enclosingDeclaration = propertySymbol.valueDeclaration || ((_a = propertySymbol.declarations) == null ? void 0 : _a[0]) || saveEnclosingDeclaration;
|
|
55455
55416
|
const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);
|
|
55456
55417
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
55457
55418
|
context.approximateLength += symbolName(propertySymbol).length + 1;
|
|
@@ -55519,8 +55480,8 @@ function createTypeChecker(host) {
|
|
|
55519
55480
|
);
|
|
55520
55481
|
typeElements.push(preserveCommentsOn(propertySignature));
|
|
55521
55482
|
function preserveCommentsOn(node) {
|
|
55522
|
-
var
|
|
55523
|
-
const jsdocPropertyTag = (
|
|
55483
|
+
var _a2;
|
|
55484
|
+
const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 348 /* JSDocPropertyTag */);
|
|
55524
55485
|
if (jsdocPropertyTag) {
|
|
55525
55486
|
const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment);
|
|
55526
55487
|
if (commentText) {
|
|
@@ -55627,7 +55588,7 @@ function createTypeChecker(host) {
|
|
|
55627
55588
|
);
|
|
55628
55589
|
}
|
|
55629
55590
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
55630
|
-
var
|
|
55591
|
+
var _a;
|
|
55631
55592
|
const flags = context.flags;
|
|
55632
55593
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
55633
55594
|
context.approximateLength += 3;
|
|
@@ -55717,7 +55678,7 @@ function createTypeChecker(host) {
|
|
|
55717
55678
|
if (typeArguments) {
|
|
55718
55679
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
55719
55680
|
}
|
|
55720
|
-
if (((
|
|
55681
|
+
if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 323 /* JSDocSignature */ && signature.declaration.parent.kind === 339 /* JSDocOverloadTag */) {
|
|
55721
55682
|
const comment = getTextOfNode(
|
|
55722
55683
|
signature.declaration.parent.parent,
|
|
55723
55684
|
/*includeTrivia*/
|
|
@@ -56049,11 +56010,11 @@ function createTypeChecker(host) {
|
|
|
56049
56010
|
return typeParameterNodes;
|
|
56050
56011
|
}
|
|
56051
56012
|
function lookupTypeParameterNodes(chain, index, context) {
|
|
56052
|
-
var
|
|
56013
|
+
var _a;
|
|
56053
56014
|
Debug.assert(chain && 0 <= index && index < chain.length);
|
|
56054
56015
|
const symbol = chain[index];
|
|
56055
56016
|
const symbolId = getSymbolId(symbol);
|
|
56056
|
-
if ((
|
|
56017
|
+
if ((_a = context.typeParameterSymbolList) == null ? void 0 : _a.has(symbolId)) {
|
|
56057
56018
|
return void 0;
|
|
56058
56019
|
}
|
|
56059
56020
|
(context.typeParameterSymbolList || (context.typeParameterSymbolList = /* @__PURE__ */ new Set())).add(symbolId);
|
|
@@ -56288,7 +56249,7 @@ function createTypeChecker(host) {
|
|
|
56288
56249
|
return false;
|
|
56289
56250
|
}
|
|
56290
56251
|
function typeParameterToName(type, context) {
|
|
56291
|
-
var
|
|
56252
|
+
var _a, _b;
|
|
56292
56253
|
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && context.typeParameterNames) {
|
|
56293
56254
|
const cached = context.typeParameterNames.get(getTypeId(type));
|
|
56294
56255
|
if (cached) {
|
|
@@ -56307,7 +56268,7 @@ function createTypeChecker(host) {
|
|
|
56307
56268
|
}
|
|
56308
56269
|
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
56309
56270
|
const rawtext = result.escapedText;
|
|
56310
|
-
let i = ((
|
|
56271
|
+
let i = ((_a = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _a.get(rawtext)) || 0;
|
|
56311
56272
|
let text = rawtext;
|
|
56312
56273
|
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsOtherTypeParameterInScope(text, context, type)) {
|
|
56313
56274
|
i++;
|
|
@@ -56483,7 +56444,7 @@ function createTypeChecker(host) {
|
|
|
56483
56444
|
return enclosingDeclaration;
|
|
56484
56445
|
}
|
|
56485
56446
|
function serializeTypeForDeclaration(context, declaration, type, symbol) {
|
|
56486
|
-
var
|
|
56447
|
+
var _a;
|
|
56487
56448
|
const addUndefined = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration);
|
|
56488
56449
|
const enclosingDeclaration = context.enclosingDeclaration;
|
|
56489
56450
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
@@ -56500,7 +56461,7 @@ function createTypeChecker(host) {
|
|
|
56500
56461
|
if (type.flags & 8192 /* UniqueESSymbol */ && type.symbol === symbol && (!context.enclosingDeclaration || some(symbol.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)))) {
|
|
56501
56462
|
context.flags |= 1048576 /* AllowUniqueESSymbolType */;
|
|
56502
56463
|
}
|
|
56503
|
-
const decl = declaration ?? symbol.valueDeclaration ?? ((
|
|
56464
|
+
const decl = declaration ?? symbol.valueDeclaration ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]);
|
|
56504
56465
|
const expr = decl && isDeclarationWithPossibleInnerTypeNodeReuse(decl) ? getPossibleTypeNodeReuseExpression(decl) : void 0;
|
|
56505
56466
|
if (decl && hasInferredType(decl) && !(context.flags & -2147483648 /* NoSyntacticPrinter */)) {
|
|
56506
56467
|
syntacticNodeBuilder.serializeTypeOfDeclaration(decl, context);
|
|
@@ -56861,7 +56822,7 @@ function createTypeChecker(host) {
|
|
|
56861
56822
|
}
|
|
56862
56823
|
}
|
|
56863
56824
|
function symbolTableToDeclarationStatements(symbolTable, context) {
|
|
56864
|
-
var
|
|
56825
|
+
var _a;
|
|
56865
56826
|
const serializePropertySymbolForClass = makeSerializePropertySymbol(
|
|
56866
56827
|
factory.createPropertyDeclaration,
|
|
56867
56828
|
174 /* MethodDeclaration */,
|
|
@@ -56883,14 +56844,14 @@ function createTypeChecker(host) {
|
|
|
56883
56844
|
...oldcontext,
|
|
56884
56845
|
usedSymbolNames: new Set(oldcontext.usedSymbolNames),
|
|
56885
56846
|
remappedSymbolNames: /* @__PURE__ */ new Map(),
|
|
56886
|
-
remappedSymbolReferences: new Map((
|
|
56847
|
+
remappedSymbolReferences: new Map((_a = oldcontext.remappedSymbolReferences) == null ? void 0 : _a.entries()),
|
|
56887
56848
|
tracker: void 0
|
|
56888
56849
|
};
|
|
56889
56850
|
const tracker = {
|
|
56890
56851
|
...oldcontext.tracker.inner,
|
|
56891
56852
|
trackSymbol: (sym, decl, meaning) => {
|
|
56892
|
-
var
|
|
56893
|
-
if ((
|
|
56853
|
+
var _a2, _b;
|
|
56854
|
+
if ((_a2 = context.remappedSymbolNames) == null ? void 0 : _a2.has(getSymbolId(sym)))
|
|
56894
56855
|
return false;
|
|
56895
56856
|
const accessibleResult = isSymbolAccessible(
|
|
56896
56857
|
sym,
|
|
@@ -57125,7 +57086,7 @@ function createTypeChecker(host) {
|
|
|
57125
57086
|
}
|
|
57126
57087
|
}
|
|
57127
57088
|
function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) {
|
|
57128
|
-
var
|
|
57089
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
57129
57090
|
const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName);
|
|
57130
57091
|
const isDefault = escapedSymbolName === "default" /* Default */;
|
|
57131
57092
|
if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && isStringANonContextualKeyword(symbolName2) && !isDefault) {
|
|
@@ -57156,7 +57117,7 @@ function createTypeChecker(host) {
|
|
|
57156
57117
|
} else {
|
|
57157
57118
|
const type = getTypeOfSymbol(symbol);
|
|
57158
57119
|
const localName = getInternalSymbolName(symbol, symbolName2);
|
|
57159
|
-
if (type.symbol && type.symbol !== symbol && type.symbol.flags & 16 /* Function */ && some(type.symbol.declarations, isFunctionExpressionOrArrowFunction) && (((
|
|
57120
|
+
if (type.symbol && type.symbol !== symbol && type.symbol.flags & 16 /* Function */ && some(type.symbol.declarations, isFunctionExpressionOrArrowFunction) && (((_a2 = type.symbol.members) == null ? void 0 : _a2.size) || ((_b = type.symbol.exports) == null ? void 0 : _b.size))) {
|
|
57160
57121
|
if (!context.remappedSymbolReferences) {
|
|
57161
57122
|
context.remappedSymbolReferences = /* @__PURE__ */ new Map();
|
|
57162
57123
|
}
|
|
@@ -57335,11 +57296,11 @@ function createTypeChecker(host) {
|
|
|
57335
57296
|
results.push(node);
|
|
57336
57297
|
}
|
|
57337
57298
|
function serializeTypeAlias(symbol, symbolName2, modifierFlags) {
|
|
57338
|
-
var
|
|
57299
|
+
var _a2;
|
|
57339
57300
|
const aliasType = getDeclaredTypeOfTypeAlias(symbol);
|
|
57340
57301
|
const typeParams = getSymbolLinks(symbol).typeParameters;
|
|
57341
57302
|
const typeParamDecls = map(typeParams, (p) => typeParameterToDeclaration(p, context));
|
|
57342
|
-
const jsdocAliasDecl = (
|
|
57303
|
+
const jsdocAliasDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isJSDocTypeAlias);
|
|
57343
57304
|
const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0);
|
|
57344
57305
|
const oldFlags = context.flags;
|
|
57345
57306
|
context.flags |= 8388608 /* InTypeAlias */;
|
|
@@ -57426,12 +57387,12 @@ function createTypeChecker(host) {
|
|
|
57426
57387
|
/*isTypeOnly*/
|
|
57427
57388
|
false,
|
|
57428
57389
|
factory.createNamedExports(mapDefined(filter(mergedMembers, (n) => n.escapedName !== "export=" /* ExportEquals */), (s) => {
|
|
57429
|
-
var
|
|
57390
|
+
var _a2, _b;
|
|
57430
57391
|
const name = unescapeLeadingUnderscores(s.escapedName);
|
|
57431
57392
|
const localName2 = getInternalSymbolName(s, name);
|
|
57432
57393
|
const aliasDecl = s.declarations && getDeclarationOfAliasSymbol(s);
|
|
57433
57394
|
if (containingFile && (aliasDecl ? containingFile !== getSourceFileOfNode(aliasDecl) : !some(s.declarations, (d) => getSourceFileOfNode(d) === containingFile))) {
|
|
57434
|
-
(_b = (
|
|
57395
|
+
(_b = (_a2 = context.tracker) == null ? void 0 : _a2.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a2, containingFile, symbol, s);
|
|
57435
57396
|
return void 0;
|
|
57436
57397
|
}
|
|
57437
57398
|
const target = aliasDecl && getTargetOfAliasDeclaration(
|
|
@@ -57597,8 +57558,8 @@ function createTypeChecker(host) {
|
|
|
57597
57558
|
return void 0;
|
|
57598
57559
|
}
|
|
57599
57560
|
function serializeAsClass(symbol, localName, modifierFlags) {
|
|
57600
|
-
var
|
|
57601
|
-
const originalDecl = (
|
|
57561
|
+
var _a2, _b;
|
|
57562
|
+
const originalDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isClassLike);
|
|
57602
57563
|
const oldEnclosing = context.enclosingDeclaration;
|
|
57603
57564
|
context.enclosingDeclaration = originalDecl || oldEnclosing;
|
|
57604
57565
|
const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
|
|
@@ -57695,7 +57656,7 @@ function createTypeChecker(host) {
|
|
|
57695
57656
|
});
|
|
57696
57657
|
}
|
|
57697
57658
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
57698
|
-
var
|
|
57659
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
57699
57660
|
const node = getDeclarationOfAliasSymbol(symbol);
|
|
57700
57661
|
if (!node)
|
|
57701
57662
|
return Debug.fail();
|
|
@@ -57715,7 +57676,7 @@ function createTypeChecker(host) {
|
|
|
57715
57676
|
includePrivateSymbol(target);
|
|
57716
57677
|
switch (node.kind) {
|
|
57717
57678
|
case 208 /* BindingElement */:
|
|
57718
|
-
if (((_b = (
|
|
57679
|
+
if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) {
|
|
57719
57680
|
const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
57720
57681
|
const { propertyName } = node;
|
|
57721
57682
|
addResult(
|
|
@@ -57938,7 +57899,7 @@ function createTypeChecker(host) {
|
|
|
57938
57899
|
);
|
|
57939
57900
|
}
|
|
57940
57901
|
function serializeMaybeAliasAssignment(symbol) {
|
|
57941
|
-
var
|
|
57902
|
+
var _a2;
|
|
57942
57903
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
57943
57904
|
return false;
|
|
57944
57905
|
}
|
|
@@ -58011,7 +57972,7 @@ function createTypeChecker(host) {
|
|
|
58011
57972
|
if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {
|
|
58012
57973
|
serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */);
|
|
58013
57974
|
} else {
|
|
58014
|
-
const flags = ((
|
|
57975
|
+
const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */;
|
|
58015
57976
|
const statement = factory.createVariableStatement(
|
|
58016
57977
|
/*modifiers*/
|
|
58017
57978
|
void 0,
|
|
@@ -58051,9 +58012,9 @@ function createTypeChecker(host) {
|
|
|
58051
58012
|
}
|
|
58052
58013
|
}
|
|
58053
58014
|
function isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, hostSymbol) {
|
|
58054
|
-
var
|
|
58015
|
+
var _a2;
|
|
58055
58016
|
const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
|
|
58056
|
-
return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !some((
|
|
58017
|
+
return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !some((_a2 = typeToSerialize.symbol) == null ? void 0 : _a2.declarations, isTypeNode) && // If the type comes straight from a type node, we shouldn't try to break it up
|
|
58057
58018
|
!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
|
|
58058
58019
|
!!(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
|
|
58059
58020
|
!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) => {
|
|
@@ -58068,7 +58029,7 @@ function createTypeChecker(host) {
|
|
|
58068
58029
|
}
|
|
58069
58030
|
function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
|
|
58070
58031
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
58071
|
-
var
|
|
58032
|
+
var _a2, _b, _c, _d, _e;
|
|
58072
58033
|
const modifierFlags = getDeclarationModifierFlagsFromSymbol(p);
|
|
58073
58034
|
const isPrivate = !!(modifierFlags & 2 /* Private */);
|
|
58074
58035
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
@@ -58079,7 +58040,7 @@ function createTypeChecker(host) {
|
|
|
58079
58040
|
}
|
|
58080
58041
|
const flag = modifierFlags & ~1024 /* Async */ | (isStatic2 ? 256 /* Static */ : 0);
|
|
58081
58042
|
const name = getPropertyNameNodeForSymbol(p, context);
|
|
58082
|
-
const firstPropertyLikeDecl = (
|
|
58043
|
+
const firstPropertyLikeDecl = (_a2 = p.declarations) == null ? void 0 : _a2.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression));
|
|
58083
58044
|
if (p.flags & 98304 /* Accessor */ && useAccessors) {
|
|
58084
58045
|
const result = [];
|
|
58085
58046
|
if (p.flags & 65536 /* SetAccessor */) {
|
|
@@ -58348,7 +58309,7 @@ function createTypeChecker(host) {
|
|
|
58348
58309
|
}
|
|
58349
58310
|
}
|
|
58350
58311
|
function getUnusedName(input, symbol) {
|
|
58351
|
-
var
|
|
58312
|
+
var _a2, _b;
|
|
58352
58313
|
const id = symbol ? getSymbolId(symbol) : void 0;
|
|
58353
58314
|
if (id) {
|
|
58354
58315
|
if (context.remappedSymbolNames.has(id)) {
|
|
@@ -58360,7 +58321,7 @@ function createTypeChecker(host) {
|
|
|
58360
58321
|
}
|
|
58361
58322
|
let i = 0;
|
|
58362
58323
|
const original = input;
|
|
58363
|
-
while ((
|
|
58324
|
+
while ((_a2 = context.usedSymbolNames) == null ? void 0 : _a2.has(input)) {
|
|
58364
58325
|
i++;
|
|
58365
58326
|
input = `${original}_${i}`;
|
|
58366
58327
|
}
|
|
@@ -58484,8 +58445,8 @@ function createTypeChecker(host) {
|
|
|
58484
58445
|
}
|
|
58485
58446
|
}
|
|
58486
58447
|
function getNameOfSymbolAsWritten(symbol, context) {
|
|
58487
|
-
var
|
|
58488
|
-
if ((
|
|
58448
|
+
var _a;
|
|
58449
|
+
if ((_a = context == null ? void 0 : context.remappedSymbolReferences) == null ? void 0 : _a.has(getSymbolId(symbol))) {
|
|
58489
58450
|
symbol = context.remappedSymbolReferences.get(getSymbolId(symbol));
|
|
58490
58451
|
}
|
|
58491
58452
|
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`
|
|
@@ -58743,9 +58704,9 @@ function createTypeChecker(host) {
|
|
|
58743
58704
|
return prop ? getTypeOfSymbol(prop) : void 0;
|
|
58744
58705
|
}
|
|
58745
58706
|
function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
|
|
58746
|
-
var
|
|
58707
|
+
var _a;
|
|
58747
58708
|
let propType;
|
|
58748
|
-
return getTypeOfPropertyOfType(type, name) || (propType = (
|
|
58709
|
+
return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality(
|
|
58749
58710
|
propType,
|
|
58750
58711
|
/*isProperty*/
|
|
58751
58712
|
true,
|
|
@@ -59233,14 +59194,14 @@ function createTypeChecker(host) {
|
|
|
59233
59194
|
return widened;
|
|
59234
59195
|
}
|
|
59235
59196
|
function getJSContainerObjectType(decl, symbol, init) {
|
|
59236
|
-
var
|
|
59197
|
+
var _a, _b;
|
|
59237
59198
|
if (!isInJSFile(decl) || !init || !isObjectLiteralExpression(init) || init.properties.length) {
|
|
59238
59199
|
return void 0;
|
|
59239
59200
|
}
|
|
59240
59201
|
const exports2 = createSymbolTable();
|
|
59241
59202
|
while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) {
|
|
59242
59203
|
const s2 = getSymbolOfNode(decl);
|
|
59243
|
-
if ((
|
|
59204
|
+
if ((_a = s2 == null ? void 0 : s2.exports) == null ? void 0 : _a.size) {
|
|
59244
59205
|
mergeSymbolTable(exports2, s2.exports);
|
|
59245
59206
|
}
|
|
59246
59207
|
decl = isBinaryExpression(decl) ? decl.parent : decl.parent.parent;
|
|
@@ -59254,7 +59215,7 @@ function createTypeChecker(host) {
|
|
|
59254
59215
|
return type;
|
|
59255
59216
|
}
|
|
59256
59217
|
function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
|
|
59257
|
-
var
|
|
59218
|
+
var _a;
|
|
59258
59219
|
const typeNode = getEffectiveTypeAnnotationNode(expression.parent);
|
|
59259
59220
|
if (typeNode) {
|
|
59260
59221
|
const type = getWidenedType(getTypeFromTypeNode(typeNode));
|
|
@@ -59270,7 +59231,7 @@ function createTypeChecker(host) {
|
|
|
59270
59231
|
);
|
|
59271
59232
|
}
|
|
59272
59233
|
}
|
|
59273
|
-
if ((
|
|
59234
|
+
if ((_a = symbol.parent) == null ? void 0 : _a.valueDeclaration) {
|
|
59274
59235
|
const possiblyAnnotatedSymbol = getFunctionExpressionParentSymbolOrSymbol(symbol.parent);
|
|
59275
59236
|
if (possiblyAnnotatedSymbol.valueDeclaration) {
|
|
59276
59237
|
const typeNode2 = getEffectiveTypeAnnotationNode(possiblyAnnotatedSymbol.valueDeclaration);
|
|
@@ -59324,13 +59285,13 @@ function createTypeChecker(host) {
|
|
|
59324
59285
|
resolvedSymbol.exports = createSymbolTable();
|
|
59325
59286
|
}
|
|
59326
59287
|
(resolvedSymbol || symbol).exports.forEach((s, name) => {
|
|
59327
|
-
var
|
|
59288
|
+
var _a;
|
|
59328
59289
|
const exportedMember = members.get(name);
|
|
59329
59290
|
if (exportedMember && exportedMember !== s && !(s.flags & 2097152 /* Alias */)) {
|
|
59330
59291
|
if (s.flags & 111551 /* Value */ && exportedMember.flags & 111551 /* Value */) {
|
|
59331
59292
|
if (s.valueDeclaration && exportedMember.valueDeclaration && getSourceFileOfNode(s.valueDeclaration) !== getSourceFileOfNode(exportedMember.valueDeclaration)) {
|
|
59332
59293
|
const unescapedName = unescapeLeadingUnderscores(s.escapedName);
|
|
59333
|
-
const exportedMemberName = ((
|
|
59294
|
+
const exportedMemberName = ((_a = tryCast(exportedMember.valueDeclaration, isNamedDeclaration)) == null ? void 0 : _a.name) || exportedMember.valueDeclaration;
|
|
59334
59295
|
addRelatedInfo(
|
|
59335
59296
|
error2(s.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapedName),
|
|
59336
59297
|
createDiagnosticForNode(exportedMemberName, Diagnostics._0_was_also_declared_here, unescapedName)
|
|
@@ -60003,11 +59964,8 @@ function createTypeChecker(host) {
|
|
|
60003
59964
|
}
|
|
60004
59965
|
}
|
|
60005
59966
|
function getOuterTypeParametersOfClassOrInterface(symbol) {
|
|
60006
|
-
var
|
|
60007
|
-
|
|
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) => {
|
|
59967
|
+
var _a;
|
|
59968
|
+
const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a = symbol.declarations) == null ? void 0 : _a.find((decl) => {
|
|
60011
59969
|
if (decl.kind === 264 /* InterfaceDeclaration */) {
|
|
60012
59970
|
return true;
|
|
60013
59971
|
}
|
|
@@ -60328,13 +60286,13 @@ function createTypeChecker(host) {
|
|
|
60328
60286
|
return links.declaredType;
|
|
60329
60287
|
}
|
|
60330
60288
|
function getDeclaredTypeOfTypeAlias(symbol) {
|
|
60331
|
-
var
|
|
60289
|
+
var _a;
|
|
60332
60290
|
const links = getSymbolLinks(symbol);
|
|
60333
60291
|
if (!links.declaredType) {
|
|
60334
60292
|
if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) {
|
|
60335
60293
|
return errorType;
|
|
60336
60294
|
}
|
|
60337
|
-
const declaration = Debug.checkDefined((
|
|
60295
|
+
const declaration = Debug.checkDefined((_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias), "Type alias symbol with no valid declaration found");
|
|
60338
60296
|
const typeNode = isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type;
|
|
60339
60297
|
let type = typeNode ? getTypeFromTypeNode(typeNode) : errorType;
|
|
60340
60298
|
if (popTypeResolution()) {
|
|
@@ -61233,8 +61191,8 @@ function createTypeChecker(host) {
|
|
|
61233
61191
|
if (symbol === globalThisSymbol) {
|
|
61234
61192
|
const varsOnly = /* @__PURE__ */ new Map();
|
|
61235
61193
|
members.forEach((p) => {
|
|
61236
|
-
var
|
|
61237
|
-
if (!(p.flags & 418 /* BlockScoped */) && !(p.flags & 512 /* ValueModule */ && ((
|
|
61194
|
+
var _a;
|
|
61195
|
+
if (!(p.flags & 418 /* BlockScoped */) && !(p.flags & 512 /* ValueModule */ && ((_a = p.declarations) == null ? void 0 : _a.length) && every(p.declarations, isAmbientModule))) {
|
|
61238
61196
|
varsOnly.set(p.escapedName, p);
|
|
61239
61197
|
}
|
|
61240
61198
|
});
|
|
@@ -61470,7 +61428,7 @@ function createTypeChecker(host) {
|
|
|
61470
61428
|
}
|
|
61471
61429
|
}
|
|
61472
61430
|
function getTypeOfMappedSymbol(symbol) {
|
|
61473
|
-
var
|
|
61431
|
+
var _a;
|
|
61474
61432
|
if (!symbol.links.type) {
|
|
61475
61433
|
const mappedType = symbol.links.mappedType;
|
|
61476
61434
|
if (!pushTypeResolution(symbol, 0 /* Type */)) {
|
|
@@ -61489,7 +61447,7 @@ function createTypeChecker(host) {
|
|
|
61489
61447
|
error2(currentNode, Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType));
|
|
61490
61448
|
type = errorType;
|
|
61491
61449
|
}
|
|
61492
|
-
(
|
|
61450
|
+
(_a = symbol.links).type ?? (_a.type = type);
|
|
61493
61451
|
}
|
|
61494
61452
|
return symbol.links.type;
|
|
61495
61453
|
}
|
|
@@ -61688,8 +61646,8 @@ function createTypeChecker(host) {
|
|
|
61688
61646
|
return !!typeVariable && isConstTypeVariable(typeVariable, depth);
|
|
61689
61647
|
}
|
|
61690
61648
|
function isConstTypeVariable(type, depth = 0) {
|
|
61691
|
-
var
|
|
61692
|
-
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((
|
|
61649
|
+
var _a;
|
|
61650
|
+
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.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));
|
|
61693
61651
|
}
|
|
61694
61652
|
function getConstraintOfIndexedAccess(type) {
|
|
61695
61653
|
return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0;
|
|
@@ -61788,7 +61746,7 @@ function createTypeChecker(host) {
|
|
|
61788
61746
|
}
|
|
61789
61747
|
}
|
|
61790
61748
|
return getNormalizedType(
|
|
61791
|
-
getIntersectionType(constraints),
|
|
61749
|
+
getIntersectionType(constraints, 2 /* NoConstraintReduction */),
|
|
61792
61750
|
/*writing*/
|
|
61793
61751
|
false
|
|
61794
61752
|
);
|
|
@@ -61980,7 +61938,7 @@ function createTypeChecker(host) {
|
|
|
61980
61938
|
return getReducedType(getApparentType(getReducedType(type)));
|
|
61981
61939
|
}
|
|
61982
61940
|
function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) {
|
|
61983
|
-
var
|
|
61941
|
+
var _a, _b, _c;
|
|
61984
61942
|
let singleProp;
|
|
61985
61943
|
let propSet;
|
|
61986
61944
|
let indexTypes;
|
|
@@ -62048,7 +62006,7 @@ function createTypeChecker(host) {
|
|
|
62048
62006
|
}
|
|
62049
62007
|
if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) {
|
|
62050
62008
|
if (mergedInstantiations) {
|
|
62051
|
-
const links = (
|
|
62009
|
+
const links = (_a = tryCast(singleProp, isTransientSymbol)) == null ? void 0 : _a.links;
|
|
62052
62010
|
const clone2 = createSymbolWithType(singleProp, links == null ? void 0 : links.type);
|
|
62053
62011
|
clone2.parent = (_c = (_b = singleProp.valueDeclaration) == null ? void 0 : _b.symbol) == null ? void 0 : _c.parent;
|
|
62054
62012
|
clone2.links.containingType = containingType;
|
|
@@ -62119,8 +62077,8 @@ function createTypeChecker(host) {
|
|
|
62119
62077
|
return result;
|
|
62120
62078
|
}
|
|
62121
62079
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
62122
|
-
var
|
|
62123
|
-
let property = skipObjectFunctionPropertyAugment ? (
|
|
62080
|
+
var _a, _b, _c;
|
|
62081
|
+
let property = skipObjectFunctionPropertyAugment ? (_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name) : (_b = type.propertyCache) == null ? void 0 : _b.get(name);
|
|
62124
62082
|
if (!property) {
|
|
62125
62083
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
62126
62084
|
if (property) {
|
|
@@ -62221,12 +62179,12 @@ function createTypeChecker(host) {
|
|
|
62221
62179
|
return errorInfo;
|
|
62222
62180
|
}
|
|
62223
62181
|
function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) {
|
|
62224
|
-
var
|
|
62182
|
+
var _a, _b;
|
|
62225
62183
|
type = getReducedApparentType(type);
|
|
62226
62184
|
if (type.flags & 524288 /* Object */) {
|
|
62227
62185
|
const resolved = resolveStructuredTypeMembers(type);
|
|
62228
62186
|
const symbol = resolved.members.get(name);
|
|
62229
|
-
if (symbol && !includeTypeOnlyMembers && ((
|
|
62187
|
+
if (symbol && !includeTypeOnlyMembers && ((_a = type.symbol) == null ? void 0 : _a.flags) & 512 /* ValueModule */ && ((_b = getSymbolLinks(type.symbol).typeOnlyExportStarMap) == null ? void 0 : _b.has(name))) {
|
|
62230
62188
|
return void 0;
|
|
62231
62189
|
}
|
|
62232
62190
|
if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) {
|
|
@@ -62278,8 +62236,8 @@ function createTypeChecker(host) {
|
|
|
62278
62236
|
}
|
|
62279
62237
|
let memberName;
|
|
62280
62238
|
if (everyType(type, (t) => {
|
|
62281
|
-
var
|
|
62282
|
-
return !!((
|
|
62239
|
+
var _a;
|
|
62240
|
+
return !!((_a = t.symbol) == null ? void 0 : _a.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
|
|
62283
62241
|
})) {
|
|
62284
62242
|
const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
|
|
62285
62243
|
const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
|
|
@@ -62343,8 +62301,8 @@ function createTypeChecker(host) {
|
|
|
62343
62301
|
return findIndexInfo(getIndexInfosOfType(type), keyType);
|
|
62344
62302
|
}
|
|
62345
62303
|
function getIndexTypeOfType(type, keyType) {
|
|
62346
|
-
var
|
|
62347
|
-
return (
|
|
62304
|
+
var _a;
|
|
62305
|
+
return (_a = getIndexInfoOfType(type, keyType)) == null ? void 0 : _a.type;
|
|
62348
62306
|
}
|
|
62349
62307
|
function getApplicableIndexInfos(type, keyType) {
|
|
62350
62308
|
return getIndexInfosOfType(type).filter((info) => isApplicableIndexType(keyType, info.keyType));
|
|
@@ -62356,12 +62314,12 @@ function createTypeChecker(host) {
|
|
|
62356
62314
|
return getApplicableIndexInfo(type, isLateBoundName(name) ? esSymbolType : getStringLiteralType(unescapeLeadingUnderscores(name)));
|
|
62357
62315
|
}
|
|
62358
62316
|
function getTypeParametersFromDeclaration(declaration) {
|
|
62359
|
-
var
|
|
62317
|
+
var _a;
|
|
62360
62318
|
let result;
|
|
62361
62319
|
for (const node of getEffectiveTypeParameterDeclarations(declaration)) {
|
|
62362
62320
|
result = appendIfUnique(result, getDeclaredTypeOfTypeParameter(node.symbol));
|
|
62363
62321
|
}
|
|
62364
|
-
return (result == null ? void 0 : result.length) ? result : isFunctionDeclaration(declaration) ? (
|
|
62322
|
+
return (result == null ? void 0 : result.length) ? result : isFunctionDeclaration(declaration) ? (_a = getSignatureOfTypeTag(declaration)) == null ? void 0 : _a.typeParameters : void 0;
|
|
62365
62323
|
}
|
|
62366
62324
|
function symbolsToArray(symbols) {
|
|
62367
62325
|
const result = [];
|
|
@@ -62848,9 +62806,9 @@ function createTypeChecker(host) {
|
|
|
62848
62806
|
return signature;
|
|
62849
62807
|
}
|
|
62850
62808
|
function getOrCreateTypeFromSignature(signature, outerTypeParameters) {
|
|
62851
|
-
var
|
|
62809
|
+
var _a;
|
|
62852
62810
|
if (!signature.isolatedSignatureType) {
|
|
62853
|
-
const kind = (
|
|
62811
|
+
const kind = (_a = signature.declaration) == null ? void 0 : _a.kind;
|
|
62854
62812
|
const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
|
|
62855
62813
|
const type = createObjectType(16 /* Anonymous */ | 134217728 /* SingleSignatureType */, createSymbol(16 /* Function */, "__function" /* Function */));
|
|
62856
62814
|
if (signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
@@ -62911,9 +62869,9 @@ function createTypeChecker(host) {
|
|
|
62911
62869
|
return mapDefined(filter(type.symbol && type.symbol.declarations, isTypeParameterDeclaration), getEffectiveConstraintOfTypeParameter)[0];
|
|
62912
62870
|
}
|
|
62913
62871
|
function getInferredTypeParameterConstraint(typeParameter, omitTypeReferences) {
|
|
62914
|
-
var
|
|
62872
|
+
var _a;
|
|
62915
62873
|
let inferences;
|
|
62916
|
-
if ((
|
|
62874
|
+
if ((_a = typeParameter.symbol) == null ? void 0 : _a.declarations) {
|
|
62917
62875
|
for (const declaration of typeParameter.symbol.declarations) {
|
|
62918
62876
|
if (declaration.parent.kind === 195 /* InferType */) {
|
|
62919
62877
|
const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent);
|
|
@@ -63054,10 +63012,10 @@ function createTypeChecker(host) {
|
|
|
63054
63012
|
return type;
|
|
63055
63013
|
}
|
|
63056
63014
|
function getTypeArguments(type) {
|
|
63057
|
-
var
|
|
63015
|
+
var _a, _b;
|
|
63058
63016
|
if (!type.resolvedTypeArguments) {
|
|
63059
63017
|
if (!pushTypeResolution(type, 6 /* ResolvedTypeArguments */)) {
|
|
63060
|
-
return ((
|
|
63018
|
+
return ((_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray;
|
|
63061
63019
|
}
|
|
63062
63020
|
const node = type.node;
|
|
63063
63021
|
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);
|
|
@@ -63188,8 +63146,8 @@ function createTypeChecker(host) {
|
|
|
63188
63146
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
63189
63147
|
}
|
|
63190
63148
|
function isLocalTypeAlias(symbol) {
|
|
63191
|
-
var
|
|
63192
|
-
const declaration = (
|
|
63149
|
+
var _a;
|
|
63150
|
+
const declaration = (_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias);
|
|
63193
63151
|
return !!(declaration && getContainingFunction(declaration));
|
|
63194
63152
|
}
|
|
63195
63153
|
function getTypeReferenceName(node) {
|
|
@@ -64026,7 +63984,7 @@ function createTypeChecker(host) {
|
|
|
64026
63984
|
return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
|
|
64027
63985
|
}
|
|
64028
63986
|
function createNormalizedTupleType(target, elementTypes) {
|
|
64029
|
-
var
|
|
63987
|
+
var _a, _b, _c, _d;
|
|
64030
63988
|
if (!(target.combinedFlags & 14 /* NonRequired */)) {
|
|
64031
63989
|
return createTypeReference(target, elementTypes);
|
|
64032
63990
|
}
|
|
@@ -64047,7 +64005,7 @@ function createTypeChecker(host) {
|
|
|
64047
64005
|
const flags = target.elementFlags[i];
|
|
64048
64006
|
if (flags & 8 /* Variadic */) {
|
|
64049
64007
|
if (type.flags & 1 /* Any */) {
|
|
64050
|
-
addElement(type, 4 /* Rest */, (
|
|
64008
|
+
addElement(type, 4 /* Rest */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
|
|
64051
64009
|
} else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
|
|
64052
64010
|
addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
|
|
64053
64011
|
} else if (isTupleType(type)) {
|
|
@@ -64060,8 +64018,8 @@ function createTypeChecker(host) {
|
|
|
64060
64018
|
return errorType;
|
|
64061
64019
|
}
|
|
64062
64020
|
forEach(elements, (t, n) => {
|
|
64063
|
-
var
|
|
64064
|
-
return addElement(t, type.target.elementFlags[n], (
|
|
64021
|
+
var _a2;
|
|
64022
|
+
return addElement(t, type.target.elementFlags[n], (_a2 = type.target.labeledElementDeclarations) == null ? void 0 : _a2[n]);
|
|
64065
64023
|
});
|
|
64066
64024
|
} else {
|
|
64067
64025
|
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
|
|
@@ -64185,7 +64143,7 @@ function createTypeChecker(host) {
|
|
|
64185
64143
|
return includes;
|
|
64186
64144
|
}
|
|
64187
64145
|
function removeSubtypes(types, hasObjectTypes) {
|
|
64188
|
-
var
|
|
64146
|
+
var _a;
|
|
64189
64147
|
if (types.length < 2) {
|
|
64190
64148
|
return types;
|
|
64191
64149
|
}
|
|
@@ -64215,7 +64173,7 @@ function createTypeChecker(host) {
|
|
|
64215
64173
|
if (count === 1e5) {
|
|
64216
64174
|
const estimatedCount = count / (len - i) * len;
|
|
64217
64175
|
if (estimatedCount > 1e6) {
|
|
64218
|
-
(
|
|
64176
|
+
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "removeSubtypes_DepthLimit", { typeIds: types.map((t) => t.id) });
|
|
64219
64177
|
error2(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);
|
|
64220
64178
|
return void 0;
|
|
64221
64179
|
}
|
|
@@ -64593,7 +64551,7 @@ function createTypeChecker(host) {
|
|
|
64593
64551
|
result.aliasTypeArguments = aliasTypeArguments;
|
|
64594
64552
|
return result;
|
|
64595
64553
|
}
|
|
64596
|
-
function getIntersectionType(types, aliasSymbol, aliasTypeArguments
|
|
64554
|
+
function getIntersectionType(types, flags = 0 /* None */, aliasSymbol, aliasTypeArguments) {
|
|
64597
64555
|
const typeMembershipMap = /* @__PURE__ */ new Map();
|
|
64598
64556
|
const includes = addTypesToIntersection(typeMembershipMap, 0, types);
|
|
64599
64557
|
const typeSet = arrayFrom(typeMembershipMap.values());
|
|
@@ -64614,7 +64572,7 @@ function createTypeChecker(host) {
|
|
|
64614
64572
|
return includes & 16777216 /* IncludesEmptyObject */ ? neverType : includes & 32768 /* Undefined */ ? undefinedType : nullType;
|
|
64615
64573
|
}
|
|
64616
64574
|
if (includes & 4 /* String */ && includes & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 8 /* Number */ && includes & 256 /* NumberLiteral */ || includes & 64 /* BigInt */ && includes & 2048 /* BigIntLiteral */ || includes & 4096 /* ESSymbol */ && includes & 8192 /* UniqueESSymbol */ || includes & 16384 /* Void */ && includes & 32768 /* Undefined */ || includes & 16777216 /* IncludesEmptyObject */ && includes & 470302716 /* DefinitelyNonNullable */) {
|
|
64617
|
-
if (!
|
|
64575
|
+
if (!(flags & 1 /* NoSupertypeReduction */))
|
|
64618
64576
|
removeRedundantSupertypes(typeSet, includes);
|
|
64619
64577
|
}
|
|
64620
64578
|
if (includes & 262144 /* IncludesMissingType */) {
|
|
@@ -64626,7 +64584,7 @@ function createTypeChecker(host) {
|
|
|
64626
64584
|
if (typeSet.length === 1) {
|
|
64627
64585
|
return typeSet[0];
|
|
64628
64586
|
}
|
|
64629
|
-
if (typeSet.length === 2) {
|
|
64587
|
+
if (typeSet.length === 2 && !(flags & 2 /* NoConstraintReduction */)) {
|
|
64630
64588
|
const typeVarIndex = typeSet[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
64631
64589
|
const typeVariable = typeSet[typeVarIndex];
|
|
64632
64590
|
const primitiveType = typeSet[1 - typeVarIndex];
|
|
@@ -64645,27 +64603,27 @@ function createTypeChecker(host) {
|
|
|
64645
64603
|
}
|
|
64646
64604
|
}
|
|
64647
64605
|
}
|
|
64648
|
-
const id = getTypeListId(typeSet) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
64606
|
+
const id = getTypeListId(typeSet) + (flags & 2 /* NoConstraintReduction */ ? "*" : getAliasId(aliasSymbol, aliasTypeArguments));
|
|
64649
64607
|
let result = intersectionTypes.get(id);
|
|
64650
64608
|
if (!result) {
|
|
64651
64609
|
if (includes & 1048576 /* Union */) {
|
|
64652
64610
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
64653
|
-
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
64611
|
+
result = getIntersectionType(typeSet, flags, aliasSymbol, aliasTypeArguments);
|
|
64654
64612
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
|
|
64655
64613
|
const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
|
|
64656
64614
|
removeFromEach(typeSet, 32768 /* Undefined */);
|
|
64657
|
-
result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
64615
|
+
result = getUnionType([getIntersectionType(typeSet, flags), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
64658
64616
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
|
|
64659
64617
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
64660
|
-
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
64618
|
+
result = getUnionType([getIntersectionType(typeSet, flags), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
64661
64619
|
} else if (typeSet.length >= 4) {
|
|
64662
64620
|
const middle = Math.floor(typeSet.length / 2);
|
|
64663
|
-
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
|
|
64621
|
+
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle), flags), getIntersectionType(typeSet.slice(middle), flags)], flags, aliasSymbol, aliasTypeArguments);
|
|
64664
64622
|
} else {
|
|
64665
64623
|
if (!checkCrossProductUnion(typeSet)) {
|
|
64666
64624
|
return errorType;
|
|
64667
64625
|
}
|
|
64668
|
-
const constituents = getCrossProductIntersections(typeSet);
|
|
64626
|
+
const constituents = getCrossProductIntersections(typeSet, flags);
|
|
64669
64627
|
const origin = some(constituents, (t) => !!(t.flags & 2097152 /* Intersection */)) && getConstituentCountOfTypes(constituents) > getConstituentCountOfTypes(typeSet) ? createOriginUnionOrIntersectionType(2097152 /* Intersection */, typeSet) : void 0;
|
|
64670
64628
|
result = getUnionType(constituents, 1 /* Literal */, aliasSymbol, aliasTypeArguments, origin);
|
|
64671
64629
|
}
|
|
@@ -64680,16 +64638,16 @@ function createTypeChecker(host) {
|
|
|
64680
64638
|
return reduceLeft(types, (n, t) => t.flags & 1048576 /* Union */ ? n * t.types.length : t.flags & 131072 /* Never */ ? 0 : n, 1);
|
|
64681
64639
|
}
|
|
64682
64640
|
function checkCrossProductUnion(types) {
|
|
64683
|
-
var
|
|
64641
|
+
var _a;
|
|
64684
64642
|
const size = getCrossProductUnionSize(types);
|
|
64685
64643
|
if (size >= 1e5) {
|
|
64686
|
-
(
|
|
64644
|
+
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkCrossProductUnion_DepthLimit", { typeIds: types.map((t) => t.id), size });
|
|
64687
64645
|
error2(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);
|
|
64688
64646
|
return false;
|
|
64689
64647
|
}
|
|
64690
64648
|
return true;
|
|
64691
64649
|
}
|
|
64692
|
-
function getCrossProductIntersections(types) {
|
|
64650
|
+
function getCrossProductIntersections(types, flags) {
|
|
64693
64651
|
const count = getCrossProductUnionSize(types);
|
|
64694
64652
|
const intersections = [];
|
|
64695
64653
|
for (let i = 0; i < count; i++) {
|
|
@@ -64703,7 +64661,7 @@ function createTypeChecker(host) {
|
|
|
64703
64661
|
n = Math.floor(n / length2);
|
|
64704
64662
|
}
|
|
64705
64663
|
}
|
|
64706
|
-
const t = getIntersectionType(constituents);
|
|
64664
|
+
const t = getIntersectionType(constituents, flags);
|
|
64707
64665
|
if (!(t.flags & 131072 /* Never */))
|
|
64708
64666
|
intersections.push(t);
|
|
64709
64667
|
}
|
|
@@ -64723,7 +64681,7 @@ function createTypeChecker(host) {
|
|
|
64723
64681
|
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
64724
64682
|
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
64725
64683
|
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
64726
|
-
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)
|
|
64684
|
+
links.resolvedType = getIntersectionType(types, noSupertypeReduction ? 1 /* NoSupertypeReduction */ : 0, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
|
|
64727
64685
|
}
|
|
64728
64686
|
return links.resolvedType;
|
|
64729
64687
|
}
|
|
@@ -64871,7 +64829,7 @@ function createTypeChecker(host) {
|
|
|
64871
64829
|
return links.resolvedType;
|
|
64872
64830
|
}
|
|
64873
64831
|
function getTemplateLiteralType(texts, types) {
|
|
64874
|
-
var
|
|
64832
|
+
var _a, _b;
|
|
64875
64833
|
const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)));
|
|
64876
64834
|
if (unionIndex >= 0) {
|
|
64877
64835
|
return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType;
|
|
@@ -64879,7 +64837,7 @@ function createTypeChecker(host) {
|
|
|
64879
64837
|
if (contains(types, wildcardType)) {
|
|
64880
64838
|
return wildcardType;
|
|
64881
64839
|
}
|
|
64882
|
-
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (
|
|
64840
|
+
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (_a = types[0].symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b.some((d) => d.parent.kind === 195 /* InferType */)) && isTypeAssignableTo(types[0], stringType)) {
|
|
64883
64841
|
return types[0];
|
|
64884
64842
|
}
|
|
64885
64843
|
const newTypes = [];
|
|
@@ -65383,7 +65341,7 @@ function createTypeChecker(host) {
|
|
|
65383
65341
|
if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
|
|
65384
65342
|
indexType = stringType;
|
|
65385
65343
|
}
|
|
65386
|
-
if (noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
65344
|
+
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
65387
65345
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
65388
65346
|
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))) {
|
|
65389
65347
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
@@ -65414,7 +65372,7 @@ function createTypeChecker(host) {
|
|
|
65414
65372
|
if (wasMissingProp) {
|
|
65415
65373
|
return void 0;
|
|
65416
65374
|
}
|
|
65417
|
-
return accessFlags & 4 /* Writing */ ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
65375
|
+
return accessFlags & 4 /* Writing */ ? getIntersectionType(propTypes, 0 /* None */, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
65418
65376
|
}
|
|
65419
65377
|
return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, accessNode, accessFlags | 8 /* CacheSymbol */ | 64 /* ReportDeprecated */);
|
|
65420
65378
|
}
|
|
@@ -65631,7 +65589,7 @@ function createTypeChecker(host) {
|
|
|
65631
65589
|
}
|
|
65632
65590
|
}
|
|
65633
65591
|
function getTypeFromImportTypeNode(node) {
|
|
65634
|
-
var
|
|
65592
|
+
var _a;
|
|
65635
65593
|
const links = getNodeLinks(node);
|
|
65636
65594
|
if (!links.resolvedType) {
|
|
65637
65595
|
if (!isLiteralImportTypeNode(node)) {
|
|
@@ -65645,7 +65603,7 @@ function createTypeChecker(host) {
|
|
|
65645
65603
|
links.resolvedSymbol = unknownSymbol;
|
|
65646
65604
|
return links.resolvedType = errorType;
|
|
65647
65605
|
}
|
|
65648
|
-
const isExportEquals = !!((
|
|
65606
|
+
const isExportEquals = !!((_a = innerModuleSymbol.exports) == null ? void 0 : _a.get("export=" /* ExportEquals */));
|
|
65649
65607
|
const moduleSymbol = resolveExternalModuleSymbol(
|
|
65650
65608
|
innerModuleSymbol,
|
|
65651
65609
|
/*dontResolveAlias*/
|
|
@@ -65850,8 +65808,8 @@ function createTypeChecker(host) {
|
|
|
65850
65808
|
return spread;
|
|
65851
65809
|
}
|
|
65852
65810
|
function isSpreadableProperty(prop) {
|
|
65853
|
-
var
|
|
65854
|
-
return !some(prop.declarations, isPrivateIdentifierClassElementDeclaration) && (!(prop.flags & (8192 /* Method */ | 32768 /* GetAccessor */ | 65536 /* SetAccessor */)) || !((
|
|
65811
|
+
var _a;
|
|
65812
|
+
return !some(prop.declarations, isPrivateIdentifierClassElementDeclaration) && (!(prop.flags & (8192 /* Method */ | 32768 /* GetAccessor */ | 65536 /* SetAccessor */)) || !((_a = prop.declarations) == null ? void 0 : _a.some((decl) => isClassLike(decl.parent))));
|
|
65855
65813
|
}
|
|
65856
65814
|
function getSpreadSymbol(prop, readonly) {
|
|
65857
65815
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
@@ -66493,12 +66451,12 @@ function createTypeChecker(host) {
|
|
|
66493
66451
|
) : type;
|
|
66494
66452
|
}
|
|
66495
66453
|
function instantiateTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
66496
|
-
var
|
|
66454
|
+
var _a;
|
|
66497
66455
|
if (!couldContainTypeVariables(type)) {
|
|
66498
66456
|
return type;
|
|
66499
66457
|
}
|
|
66500
66458
|
if (instantiationDepth === 100 || instantiationCount >= 5e6) {
|
|
66501
|
-
(
|
|
66459
|
+
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth, instantiationCount });
|
|
66502
66460
|
error2(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
66503
66461
|
return errorType;
|
|
66504
66462
|
}
|
|
@@ -66538,7 +66496,7 @@ function createTypeChecker(host) {
|
|
|
66538
66496
|
}
|
|
66539
66497
|
const newAliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
66540
66498
|
const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
|
|
66541
|
-
return flags & 2097152 /* Intersection */ || origin && origin.flags & 2097152 /* Intersection */ ? getIntersectionType(newTypes, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1 /* Literal */, newAliasSymbol, newAliasTypeArguments);
|
|
66499
|
+
return flags & 2097152 /* Intersection */ || origin && origin.flags & 2097152 /* Intersection */ ? getIntersectionType(newTypes, 0 /* None */, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1 /* Literal */, newAliasSymbol, newAliasTypeArguments);
|
|
66542
66500
|
}
|
|
66543
66501
|
if (flags & 4194304 /* Index */) {
|
|
66544
66502
|
return getIndexType(instantiateType(type.type, mapper));
|
|
@@ -67672,7 +67630,7 @@ function createTypeChecker(host) {
|
|
|
67672
67630
|
return elements !== normalizedElements ? createNormalizedTupleType(type.target, normalizedElements) : type;
|
|
67673
67631
|
}
|
|
67674
67632
|
function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) {
|
|
67675
|
-
var
|
|
67633
|
+
var _a;
|
|
67676
67634
|
let errorInfo;
|
|
67677
67635
|
let relatedInfo;
|
|
67678
67636
|
let maybeKeys;
|
|
@@ -67712,7 +67670,7 @@ function createTypeChecker(host) {
|
|
|
67712
67670
|
false
|
|
67713
67671
|
);
|
|
67714
67672
|
relation.set(id, 4 /* Reported */ | 2 /* Failed */);
|
|
67715
|
-
(
|
|
67673
|
+
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth });
|
|
67716
67674
|
const message = relationCount <= 0 ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1;
|
|
67717
67675
|
const diag2 = error2(errorNode || currentNode, message, typeToString(source), typeToString(target));
|
|
67718
67676
|
if (errorOutputContainer) {
|
|
@@ -68087,7 +68045,7 @@ function createTypeChecker(host) {
|
|
|
68087
68045
|
return 0 /* False */;
|
|
68088
68046
|
}
|
|
68089
68047
|
function reportErrorResults(originalSource, originalTarget, source2, target2, headMessage2) {
|
|
68090
|
-
var
|
|
68048
|
+
var _a2, _b;
|
|
68091
68049
|
const sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
68092
68050
|
const targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
68093
68051
|
source2 = originalSource.aliasSymbol || sourceHasBase ? originalSource : source2;
|
|
@@ -68137,7 +68095,7 @@ function createTypeChecker(host) {
|
|
|
68137
68095
|
return;
|
|
68138
68096
|
}
|
|
68139
68097
|
reportRelationError(headMessage2, source2, target2);
|
|
68140
|
-
if (source2.flags & 262144 /* TypeParameter */ && ((_b = (
|
|
68098
|
+
if (source2.flags & 262144 /* TypeParameter */ && ((_b = (_a2 = source2.symbol) == null ? void 0 : _a2.declarations) == null ? void 0 : _b[0]) && !getConstraintOfType(source2)) {
|
|
68141
68099
|
const syntheticParam = cloneTypeParameter(source2);
|
|
68142
68100
|
syntheticParam.constraint = instantiateType(target2, makeUnaryTypeMapper(source2, syntheticParam));
|
|
68143
68101
|
if (hasNonCircularBaseConstraint(syntheticParam)) {
|
|
@@ -68172,10 +68130,10 @@ function createTypeChecker(host) {
|
|
|
68172
68130
|
}
|
|
68173
68131
|
function getTypeOfPropertyInTypes(types, name) {
|
|
68174
68132
|
const appendPropType = (propTypes, type) => {
|
|
68175
|
-
var
|
|
68133
|
+
var _a2;
|
|
68176
68134
|
type = getApparentType(type);
|
|
68177
68135
|
const prop = type.flags & 3145728 /* UnionOrIntersection */ ? getPropertyOfUnionOrIntersectionType(type, name) : getPropertyOfObjectType(type, name);
|
|
68178
|
-
const propType = prop && getTypeOfSymbol(prop) || ((
|
|
68136
|
+
const propType = prop && getTypeOfSymbol(prop) || ((_a2 = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a2.type) || undefinedType;
|
|
68179
68137
|
return append(propTypes, propType);
|
|
68180
68138
|
};
|
|
68181
68139
|
return getUnionType(reduceLeft(
|
|
@@ -68186,7 +68144,7 @@ function createTypeChecker(host) {
|
|
|
68186
68144
|
) || emptyArray);
|
|
68187
68145
|
}
|
|
68188
68146
|
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
68189
|
-
var
|
|
68147
|
+
var _a2;
|
|
68190
68148
|
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 4096 /* JSLiteral */) {
|
|
68191
68149
|
return false;
|
|
68192
68150
|
}
|
|
@@ -68220,7 +68178,7 @@ function createTypeChecker(host) {
|
|
|
68220
68178
|
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));
|
|
68221
68179
|
}
|
|
68222
68180
|
} else {
|
|
68223
|
-
const objectLiteralDeclaration = ((
|
|
68181
|
+
const objectLiteralDeclaration = ((_a2 = source2.symbol) == null ? void 0 : _a2.declarations) && firstOrUndefined(source2.symbol.declarations);
|
|
68224
68182
|
let suggestion;
|
|
68225
68183
|
if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, (d) => d === objectLiteralDeclaration) && getSourceFileOfNode(objectLiteralDeclaration) === getSourceFileOfNode(errorNode)) {
|
|
68226
68184
|
const propDeclaration = prop.valueDeclaration;
|
|
@@ -68560,7 +68518,7 @@ function createTypeChecker(host) {
|
|
|
68560
68518
|
return result2;
|
|
68561
68519
|
}
|
|
68562
68520
|
function recursiveTypeRelatedTo(source2, target2, reportErrors2, intersectionState, recursionFlags) {
|
|
68563
|
-
var
|
|
68521
|
+
var _a2, _b, _c;
|
|
68564
68522
|
if (overflow) {
|
|
68565
68523
|
return 0 /* False */;
|
|
68566
68524
|
}
|
|
@@ -68645,7 +68603,7 @@ function createTypeChecker(host) {
|
|
|
68645
68603
|
}
|
|
68646
68604
|
let result2;
|
|
68647
68605
|
if (expandingFlags === 3 /* Both */) {
|
|
68648
|
-
(
|
|
68606
|
+
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "recursiveTypeRelatedTo_DepthLimit", {
|
|
68649
68607
|
sourceId: source2.id,
|
|
68650
68608
|
sourceIdStack: sourceStack.map((t) => t.id),
|
|
68651
68609
|
targetId: target2.id,
|
|
@@ -69326,7 +69284,7 @@ function createTypeChecker(host) {
|
|
|
69326
69284
|
return 0 /* False */;
|
|
69327
69285
|
}
|
|
69328
69286
|
function typeRelatedToDiscriminatedType(source2, target2) {
|
|
69329
|
-
var
|
|
69287
|
+
var _a2;
|
|
69330
69288
|
const sourceProperties = getPropertiesOfType(source2);
|
|
69331
69289
|
const sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target2);
|
|
69332
69290
|
if (!sourcePropertiesFiltered)
|
|
@@ -69335,7 +69293,7 @@ function createTypeChecker(host) {
|
|
|
69335
69293
|
for (const sourceProperty of sourcePropertiesFiltered) {
|
|
69336
69294
|
numCombinations *= countTypes(getNonMissingTypeOfSymbol(sourceProperty));
|
|
69337
69295
|
if (numCombinations > 25) {
|
|
69338
|
-
(
|
|
69296
|
+
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source2.id, targetId: target2.id, numCombinations });
|
|
69339
69297
|
return 0 /* False */;
|
|
69340
69298
|
}
|
|
69341
69299
|
}
|
|
@@ -69742,7 +69700,7 @@ function createTypeChecker(host) {
|
|
|
69742
69700
|
return result2;
|
|
69743
69701
|
}
|
|
69744
69702
|
function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) {
|
|
69745
|
-
var
|
|
69703
|
+
var _a2, _b;
|
|
69746
69704
|
if (relation === identityRelation) {
|
|
69747
69705
|
return signaturesIdenticalTo(source2, target2, kind);
|
|
69748
69706
|
}
|
|
@@ -69798,7 +69756,7 @@ function createTypeChecker(host) {
|
|
|
69798
69756
|
const sourceSignature = first(sourceSignatures);
|
|
69799
69757
|
const targetSignature = first(targetSignatures);
|
|
69800
69758
|
result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature));
|
|
69801
|
-
if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((
|
|
69759
|
+
if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a2 = targetSignature.declaration) == null ? void 0 : _a2.kind) === 176 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176 /* Constructor */)) {
|
|
69802
69760
|
const constructSignatureToString = (signature) => signatureToString(
|
|
69803
69761
|
signature,
|
|
69804
69762
|
/*enclosingDeclaration*/
|
|
@@ -70116,10 +70074,10 @@ function createTypeChecker(host) {
|
|
|
70116
70074
|
return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters);
|
|
70117
70075
|
}
|
|
70118
70076
|
function getVariancesWorker(symbol, typeParameters = emptyArray) {
|
|
70119
|
-
var
|
|
70077
|
+
var _a, _b;
|
|
70120
70078
|
const links = getSymbolLinks(symbol);
|
|
70121
70079
|
if (!links.variances) {
|
|
70122
|
-
(
|
|
70080
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
70123
70081
|
const oldVarianceComputation = inVarianceComputation;
|
|
70124
70082
|
const saveResolutionStart = resolutionStart;
|
|
70125
70083
|
if (!inVarianceComputation) {
|
|
@@ -70177,8 +70135,8 @@ function createTypeChecker(host) {
|
|
|
70177
70135
|
return markerTypes.has(getTypeId(type));
|
|
70178
70136
|
}
|
|
70179
70137
|
function getTypeParameterModifiers(tp) {
|
|
70180
|
-
var
|
|
70181
|
-
return reduceLeft((
|
|
70138
|
+
var _a;
|
|
70139
|
+
return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (8192 /* In */ | 16384 /* Out */ | 4096 /* Const */);
|
|
70182
70140
|
}
|
|
70183
70141
|
function hasCovariantVoidArgument(typeArguments, variances) {
|
|
70184
70142
|
for (let i = 0; i < variances.length; i++) {
|
|
@@ -70236,7 +70194,7 @@ function createTypeChecker(host) {
|
|
|
70236
70194
|
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : `${source.id},${target.id}${postFix}`;
|
|
70237
70195
|
}
|
|
70238
70196
|
function forEachProperty2(prop, callback) {
|
|
70239
|
-
if (getCheckFlags(prop) & 6 /*
|
|
70197
|
+
if (getCheckFlags(prop) & 6 /* Synthetic */) {
|
|
70240
70198
|
for (const t of prop.links.containingType.types) {
|
|
70241
70199
|
const p = getPropertyOfType(t, prop.escapedName);
|
|
70242
70200
|
const result = p && forEachProperty2(p, callback);
|
|
@@ -70534,7 +70492,7 @@ function createTypeChecker(host) {
|
|
|
70534
70492
|
return propType;
|
|
70535
70493
|
}
|
|
70536
70494
|
if (everyType(type, isTupleType)) {
|
|
70537
|
-
return getTupleElementTypeOutOfStartCount(type, index, noUncheckedIndexedAccess ? undefinedType : void 0);
|
|
70495
|
+
return getTupleElementTypeOutOfStartCount(type, index, compilerOptions.noUncheckedIndexedAccess ? undefinedType : void 0);
|
|
70538
70496
|
}
|
|
70539
70497
|
return void 0;
|
|
70540
70498
|
}
|
|
@@ -71853,7 +71811,7 @@ function createTypeChecker(host) {
|
|
|
71853
71811
|
inferFromTypes(sourceNameType, targetNameType);
|
|
71854
71812
|
}
|
|
71855
71813
|
function inferFromObjectTypes(source, target) {
|
|
71856
|
-
var
|
|
71814
|
+
var _a, _b;
|
|
71857
71815
|
if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
|
|
71858
71816
|
inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target));
|
|
71859
71817
|
return;
|
|
@@ -71900,7 +71858,7 @@ function createTypeChecker(host) {
|
|
|
71900
71858
|
inferFromTypes(sliceTupleType(source, startLength + targetInfo.impliedArity, endLength), elementTypes[startLength + 1]);
|
|
71901
71859
|
}
|
|
71902
71860
|
} else if (elementFlags[startLength] & 8 /* Variadic */ && elementFlags[startLength + 1] & 4 /* Rest */) {
|
|
71903
|
-
const param = (
|
|
71861
|
+
const param = (_a = getInferenceInfoForType(elementTypes[startLength])) == null ? void 0 : _a.typeParameter;
|
|
71904
71862
|
const constraint = param && getBaseConstraintOfType(param);
|
|
71905
71863
|
if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) {
|
|
71906
71864
|
const impliedArity = constraint.target.fixedLength;
|
|
@@ -72387,8 +72345,8 @@ function createTypeChecker(host) {
|
|
|
72387
72345
|
return unionType.keyPropertyName.length ? unionType.keyPropertyName : void 0;
|
|
72388
72346
|
}
|
|
72389
72347
|
function getConstituentTypeForKeyType(unionType, keyType) {
|
|
72390
|
-
var
|
|
72391
|
-
const result = (
|
|
72348
|
+
var _a;
|
|
72349
|
+
const result = (_a = unionType.constituentMap) == null ? void 0 : _a.get(getTypeId(getRegularTypeOfLiteralType(keyType)));
|
|
72392
72350
|
return result !== unknownType ? result : void 0;
|
|
72393
72351
|
}
|
|
72394
72352
|
function getMatchingUnionConstituentForType(unionType, type) {
|
|
@@ -72572,12 +72530,12 @@ function createTypeChecker(host) {
|
|
|
72572
72530
|
return defaultExpression ? getUnionType([getNonUndefinedType(type), getTypeOfExpression(defaultExpression)]) : type;
|
|
72573
72531
|
}
|
|
72574
72532
|
function getTypeOfDestructuredProperty(type, name) {
|
|
72575
|
-
var
|
|
72533
|
+
var _a;
|
|
72576
72534
|
const nameType = getLiteralTypeFromPropertyName(name);
|
|
72577
72535
|
if (!isTypeUsableAsPropertyName(nameType))
|
|
72578
72536
|
return errorType;
|
|
72579
72537
|
const text = getPropertyNameFromType(nameType);
|
|
72580
|
-
return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((
|
|
72538
|
+
return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((_a = getApplicableIndexInfoForName(type, text)) == null ? void 0 : _a.type) || errorType;
|
|
72581
72539
|
}
|
|
72582
72540
|
function getTypeOfDestructuredArrayElement(type, index) {
|
|
72583
72541
|
return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(
|
|
@@ -72591,7 +72549,7 @@ function createTypeChecker(host) {
|
|
|
72591
72549
|
function includeUndefinedInIndexSignature(type) {
|
|
72592
72550
|
if (!type)
|
|
72593
72551
|
return type;
|
|
72594
|
-
return noUncheckedIndexedAccess ? getUnionType([type, missingType]) : type;
|
|
72552
|
+
return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type, missingType]) : type;
|
|
72595
72553
|
}
|
|
72596
72554
|
function getTypeOfDestructuredSpreadExpression(type) {
|
|
72597
72555
|
return createArrayType(checkIteratedTypeOrElementType(
|
|
@@ -73154,7 +73112,7 @@ function createTypeChecker(host) {
|
|
|
73154
73112
|
}
|
|
73155
73113
|
return false;
|
|
73156
73114
|
}
|
|
73157
|
-
function getFlowTypeOfReference(reference, declaredType, initialType = declaredType, flowContainer, flowNode = ((
|
|
73115
|
+
function getFlowTypeOfReference(reference, declaredType, initialType = declaredType, flowContainer, flowNode = ((_a) => (_a = tryCast(reference, canHaveFlowNode)) == null ? void 0 : _a.flowNode)()) {
|
|
73158
73116
|
let key;
|
|
73159
73117
|
let isKeySet = false;
|
|
73160
73118
|
let flowDepth = 0;
|
|
@@ -74416,7 +74374,7 @@ function createTypeChecker(host) {
|
|
|
74416
74374
|
}
|
|
74417
74375
|
}
|
|
74418
74376
|
function getNarrowedTypeOfSymbol(symbol, location, checkMode) {
|
|
74419
|
-
var
|
|
74377
|
+
var _a;
|
|
74420
74378
|
const type = getTypeOfSymbol(symbol, checkMode);
|
|
74421
74379
|
const declaration = symbol.valueDeclaration;
|
|
74422
74380
|
if (declaration) {
|
|
@@ -74458,7 +74416,7 @@ function createTypeChecker(host) {
|
|
|
74458
74416
|
if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
|
|
74459
74417
|
const contextualSignature = getContextualSignature(func);
|
|
74460
74418
|
if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
|
|
74461
|
-
const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (
|
|
74419
|
+
const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a = getInferenceContext(func)) == null ? void 0 : _a.nonFixingMapper));
|
|
74462
74420
|
if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !some(func.parameters, isSomeSymbolAssigned)) {
|
|
74463
74421
|
const narrowedType = getFlowTypeOfReference(
|
|
74464
74422
|
func,
|
|
@@ -74610,7 +74568,7 @@ function createTypeChecker(host) {
|
|
|
74610
74568
|
}
|
|
74611
74569
|
}
|
|
74612
74570
|
function shouldMarkIdentifierAliasReferenced(node) {
|
|
74613
|
-
var
|
|
74571
|
+
var _a;
|
|
74614
74572
|
const parent2 = node.parent;
|
|
74615
74573
|
if (parent2) {
|
|
74616
74574
|
if (isPropertyAccessExpression(parent2) && parent2.expression === node) {
|
|
@@ -74619,7 +74577,7 @@ function createTypeChecker(host) {
|
|
|
74619
74577
|
if (isExportSpecifier(parent2) && parent2.isTypeOnly) {
|
|
74620
74578
|
return false;
|
|
74621
74579
|
}
|
|
74622
|
-
const greatGrandparent = (
|
|
74580
|
+
const greatGrandparent = (_a = parent2.parent) == null ? void 0 : _a.parent;
|
|
74623
74581
|
if (greatGrandparent && isExportDeclaration(greatGrandparent) && greatGrandparent.isTypeOnly) {
|
|
74624
74582
|
return false;
|
|
74625
74583
|
}
|
|
@@ -75351,7 +75309,7 @@ function createTypeChecker(host) {
|
|
|
75351
75309
|
}
|
|
75352
75310
|
}
|
|
75353
75311
|
function getContextualTypeForAssignmentDeclaration(binaryExpression) {
|
|
75354
|
-
var
|
|
75312
|
+
var _a, _b;
|
|
75355
75313
|
const kind = getAssignmentDeclarationKind(binaryExpression);
|
|
75356
75314
|
switch (kind) {
|
|
75357
75315
|
case 0 /* None */:
|
|
@@ -75410,7 +75368,7 @@ function createTypeChecker(host) {
|
|
|
75410
75368
|
case 2 /* ModuleExports */:
|
|
75411
75369
|
let valueDeclaration;
|
|
75412
75370
|
if (kind !== 2 /* ModuleExports */) {
|
|
75413
|
-
valueDeclaration = canHaveSymbol(binaryExpression.left) ? (
|
|
75371
|
+
valueDeclaration = canHaveSymbol(binaryExpression.left) ? (_a = binaryExpression.left.symbol) == null ? void 0 : _a.valueDeclaration : void 0;
|
|
75414
75372
|
}
|
|
75415
75373
|
valueDeclaration || (valueDeclaration = (_b = binaryExpression.symbol) == null ? void 0 : _b.valueDeclaration);
|
|
75416
75374
|
const annotated = valueDeclaration && getEffectiveTypeAnnotationNode(valueDeclaration);
|
|
@@ -75477,7 +75435,7 @@ function createTypeChecker(host) {
|
|
|
75477
75435
|
return mapType(
|
|
75478
75436
|
type,
|
|
75479
75437
|
(t) => {
|
|
75480
|
-
var
|
|
75438
|
+
var _a;
|
|
75481
75439
|
if (isGenericMappedType(t) && !t.declaration.nameType) {
|
|
75482
75440
|
const constraint = getConstraintTypeFromMappedType(t);
|
|
75483
75441
|
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
@@ -75505,7 +75463,7 @@ function createTypeChecker(host) {
|
|
|
75505
75463
|
return restType;
|
|
75506
75464
|
}
|
|
75507
75465
|
}
|
|
75508
|
-
return (
|
|
75466
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
75509
75467
|
}
|
|
75510
75468
|
return void 0;
|
|
75511
75469
|
},
|
|
@@ -75547,8 +75505,8 @@ function createTypeChecker(host) {
|
|
|
75547
75505
|
return mapType(
|
|
75548
75506
|
type,
|
|
75549
75507
|
(t) => {
|
|
75550
|
-
var
|
|
75551
|
-
return (
|
|
75508
|
+
var _a;
|
|
75509
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType)) == null ? void 0 : _a.type;
|
|
75552
75510
|
},
|
|
75553
75511
|
/*noReductions*/
|
|
75554
75512
|
true
|
|
@@ -75690,8 +75648,8 @@ function createTypeChecker(host) {
|
|
|
75690
75648
|
),
|
|
75691
75649
|
map(
|
|
75692
75650
|
filter(getPropertiesOfType(contextualType), (s) => {
|
|
75693
|
-
var
|
|
75694
|
-
return !!(s.flags & 16777216 /* Optional */) && !!((
|
|
75651
|
+
var _a;
|
|
75652
|
+
return !!(s.flags & 16777216 /* Optional */) && !!((_a = node == null ? void 0 : node.symbol) == null ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName);
|
|
75695
75653
|
}),
|
|
75696
75654
|
(s) => [() => undefinedType, s.escapedName]
|
|
75697
75655
|
)
|
|
@@ -75717,8 +75675,8 @@ function createTypeChecker(host) {
|
|
|
75717
75675
|
),
|
|
75718
75676
|
map(
|
|
75719
75677
|
filter(getPropertiesOfType(contextualType), (s) => {
|
|
75720
|
-
var
|
|
75721
|
-
if (!(s.flags & 16777216 /* Optional */) || !((
|
|
75678
|
+
var _a;
|
|
75679
|
+
if (!(s.flags & 16777216 /* Optional */) || !((_a = node == null ? void 0 : node.symbol) == null ? void 0 : _a.members)) {
|
|
75722
75680
|
return false;
|
|
75723
75681
|
}
|
|
75724
75682
|
const element = node.parent.parent;
|
|
@@ -75777,7 +75735,7 @@ function createTypeChecker(host) {
|
|
|
75777
75735
|
return type;
|
|
75778
75736
|
}
|
|
75779
75737
|
function getContextualType2(node, contextFlags) {
|
|
75780
|
-
var
|
|
75738
|
+
var _a;
|
|
75781
75739
|
if (node.flags & 67108864 /* InWithStatement */) {
|
|
75782
75740
|
return void 0;
|
|
75783
75741
|
}
|
|
@@ -75823,7 +75781,7 @@ function createTypeChecker(host) {
|
|
|
75823
75781
|
const arrayLiteral = parent2;
|
|
75824
75782
|
const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);
|
|
75825
75783
|
const elementIndex = indexOfNode(arrayLiteral.elements, node);
|
|
75826
|
-
const spreadIndices = (
|
|
75784
|
+
const spreadIndices = (_a = getNodeLinks(arrayLiteral)).spreadIndices ?? (_a.spreadIndices = getSpreadIndices(arrayLiteral.elements));
|
|
75827
75785
|
return getContextualTypeForElementExpression(type, elementIndex, arrayLiteral.elements.length, spreadIndices.first, spreadIndices.last);
|
|
75828
75786
|
}
|
|
75829
75787
|
case 227 /* ConditionalExpression */:
|
|
@@ -76355,13 +76313,13 @@ function createTypeChecker(host) {
|
|
|
76355
76313
|
return links.resolvedType;
|
|
76356
76314
|
}
|
|
76357
76315
|
function isSymbolWithNumericName(symbol) {
|
|
76358
|
-
var
|
|
76359
|
-
const firstDecl = (
|
|
76316
|
+
var _a;
|
|
76317
|
+
const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
|
|
76360
76318
|
return isNumericLiteralName(symbol.escapedName) || firstDecl && isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name);
|
|
76361
76319
|
}
|
|
76362
76320
|
function isSymbolWithSymbolName(symbol) {
|
|
76363
|
-
var
|
|
76364
|
-
const firstDecl = (
|
|
76321
|
+
var _a;
|
|
76322
|
+
const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
|
|
76365
76323
|
return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
|
|
76366
76324
|
}
|
|
76367
76325
|
function getObjectLiteralIndexInfo(node, offset, properties, keyType) {
|
|
@@ -76391,7 +76349,7 @@ function createTypeChecker(host) {
|
|
|
76391
76349
|
return links.immediateTarget;
|
|
76392
76350
|
}
|
|
76393
76351
|
function checkObjectLiteral(node, checkMode = 0 /* Normal */) {
|
|
76394
|
-
var
|
|
76352
|
+
var _a;
|
|
76395
76353
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
76396
76354
|
checkGrammarObjectLiteralExpression(node, inDestructuringPattern);
|
|
76397
76355
|
const allPropertiesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
@@ -76532,7 +76490,7 @@ function createTypeChecker(host) {
|
|
|
76532
76490
|
for (const prop of getPropertiesOfType(contextualType)) {
|
|
76533
76491
|
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
|
|
76534
76492
|
if (!(prop.flags & 16777216 /* Optional */)) {
|
|
76535
|
-
error2(prop.valueDeclaration || ((
|
|
76493
|
+
error2(prop.valueDeclaration || ((_a = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a.links.bindingElement), Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
|
|
76536
76494
|
}
|
|
76537
76495
|
propertiesTable.set(prop.escapedName, prop);
|
|
76538
76496
|
propertiesArray.push(prop);
|
|
@@ -76996,7 +76954,7 @@ function createTypeChecker(host) {
|
|
|
76996
76954
|
}
|
|
76997
76955
|
}
|
|
76998
76956
|
function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
|
|
76999
|
-
var
|
|
76957
|
+
var _a;
|
|
77000
76958
|
Debug.assert(isJsxIntrinsicTagName(node.tagName));
|
|
77001
76959
|
const links = getNodeLinks(node);
|
|
77002
76960
|
if (!links.resolvedJsxElementAttributesType) {
|
|
@@ -77005,7 +76963,7 @@ function createTypeChecker(host) {
|
|
|
77005
76963
|
return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType;
|
|
77006
76964
|
} else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {
|
|
77007
76965
|
const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
|
|
77008
|
-
return links.resolvedJsxElementAttributesType = ((
|
|
76966
|
+
return links.resolvedJsxElementAttributesType = ((_a = getApplicableIndexInfoForName(getJsxType(JsxNames.IntrinsicElements, node), propName)) == null ? void 0 : _a.type) || errorType;
|
|
77009
76967
|
} else {
|
|
77010
76968
|
return links.resolvedJsxElementAttributesType = errorType;
|
|
77011
76969
|
}
|
|
@@ -77182,7 +77140,7 @@ function createTypeChecker(host) {
|
|
|
77182
77140
|
return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
|
|
77183
77141
|
}
|
|
77184
77142
|
function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
|
|
77185
|
-
var
|
|
77143
|
+
var _a;
|
|
77186
77144
|
const flags = getDeclarationModifierFlagsFromSymbol(prop, writing);
|
|
77187
77145
|
if (isSuper) {
|
|
77188
77146
|
if (languageVersion < 2 /* ES2015 */) {
|
|
@@ -77199,7 +77157,7 @@ function createTypeChecker(host) {
|
|
|
77199
77157
|
}
|
|
77200
77158
|
return false;
|
|
77201
77159
|
}
|
|
77202
|
-
if (!(flags & 256 /* Static */) && ((
|
|
77160
|
+
if (!(flags & 256 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassInstanceProperty))) {
|
|
77203
77161
|
if (errorNode) {
|
|
77204
77162
|
error2(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
|
77205
77163
|
}
|
|
@@ -77586,7 +77544,7 @@ function createTypeChecker(host) {
|
|
|
77586
77544
|
error2(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
|
|
77587
77545
|
}
|
|
77588
77546
|
propType = indexInfo.type;
|
|
77589
|
-
if (noUncheckedIndexedAccess && getAssignmentTargetKind(node) !== 1 /* Definite */) {
|
|
77547
|
+
if (compilerOptions.noUncheckedIndexedAccess && getAssignmentTargetKind(node) !== 1 /* Definite */) {
|
|
77590
77548
|
propType = getUnionType([propType, missingType]);
|
|
77591
77549
|
}
|
|
77592
77550
|
if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) {
|
|
@@ -77613,12 +77571,12 @@ function createTypeChecker(host) {
|
|
|
77613
77571
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
77614
77572
|
}
|
|
77615
77573
|
function isUncheckedJSSuggestion(node, suggestion, excludeClasses) {
|
|
77616
|
-
var
|
|
77574
|
+
var _a;
|
|
77617
77575
|
const file = getSourceFileOfNode(node);
|
|
77618
77576
|
if (file) {
|
|
77619
77577
|
if (compilerOptions.checkJs === void 0 && file.checkJsDirective === void 0 && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */)) {
|
|
77620
77578
|
const declarationFile = forEach(suggestion == null ? void 0 : suggestion.declarations, getSourceFileOfNode);
|
|
77621
|
-
const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((
|
|
77579
|
+
const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((_a = suggestion.valueDeclaration.heritageClauses) == null ? void 0 : _a.length) || classOrConstructorParameterIsDecorated(
|
|
77622
77580
|
/*useLegacyDecorators*/
|
|
77623
77581
|
false,
|
|
77624
77582
|
suggestion.valueDeclaration
|
|
@@ -78416,7 +78374,7 @@ function createTypeChecker(host) {
|
|
|
78416
78374
|
errorOutputContainer
|
|
78417
78375
|
);
|
|
78418
78376
|
function checkTagNameDoesNotExpectTooManyArguments() {
|
|
78419
|
-
var
|
|
78377
|
+
var _a;
|
|
78420
78378
|
if (getJsxNamespaceContainerForImplicitImport(node)) {
|
|
78421
78379
|
return true;
|
|
78422
78380
|
}
|
|
@@ -78482,7 +78440,7 @@ function createTypeChecker(host) {
|
|
|
78482
78440
|
}
|
|
78483
78441
|
if (reportErrors2) {
|
|
78484
78442
|
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);
|
|
78485
|
-
const tagNameDeclaration = (
|
|
78443
|
+
const tagNameDeclaration = (_a = getSymbolAtLocation(node.tagName)) == null ? void 0 : _a.valueDeclaration;
|
|
78486
78444
|
if (tagNameDeclaration) {
|
|
78487
78445
|
addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics._0_is_declared_here, entityNameToString(node.tagName)));
|
|
78488
78446
|
}
|
|
@@ -78631,9 +78589,9 @@ function createTypeChecker(host) {
|
|
|
78631
78589
|
const spreadType = arg.kind === 230 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
78632
78590
|
if (spreadType && isTupleType(spreadType)) {
|
|
78633
78591
|
forEach(getElementTypes(spreadType), (t, i2) => {
|
|
78634
|
-
var
|
|
78592
|
+
var _a;
|
|
78635
78593
|
const flags = spreadType.target.elementFlags[i2];
|
|
78636
|
-
const syntheticArg = createSyntheticExpression(arg, flags & 4 /* Rest */ ? createArrayType(t) : t, !!(flags & 12 /* Variable */), (
|
|
78594
|
+
const syntheticArg = createSyntheticExpression(arg, flags & 4 /* Rest */ ? createArrayType(t) : t, !!(flags & 12 /* Variable */), (_a = spreadType.target.labeledElementDeclarations) == null ? void 0 : _a[i2]);
|
|
78637
78595
|
effectiveArgs.push(syntheticArg);
|
|
78638
78596
|
});
|
|
78639
78597
|
} else {
|
|
@@ -78741,7 +78699,7 @@ function createTypeChecker(host) {
|
|
|
78741
78699
|
return constructorSymbol === globalPromiseSymbol;
|
|
78742
78700
|
}
|
|
78743
78701
|
function getArgumentArityError(node, signatures, args, headMessage) {
|
|
78744
|
-
var
|
|
78702
|
+
var _a;
|
|
78745
78703
|
const spreadIndex = getSpreadArgumentIndex(args);
|
|
78746
78704
|
if (spreadIndex > -1) {
|
|
78747
78705
|
return createDiagnosticForNode(args[spreadIndex], Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);
|
|
@@ -78800,7 +78758,7 @@ function createTypeChecker(host) {
|
|
|
78800
78758
|
} else {
|
|
78801
78759
|
diagnostic = getDiagnosticForCallNode(node, error3, parameterRange, args.length);
|
|
78802
78760
|
}
|
|
78803
|
-
const parameter = (
|
|
78761
|
+
const parameter = (_a = closestSignature == null ? void 0 : closestSignature.declaration) == null ? void 0 : _a.parameters[closestSignature.thisParameter ? args.length + 1 : args.length];
|
|
78804
78762
|
if (parameter) {
|
|
78805
78763
|
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))];
|
|
78806
78764
|
const parameterError = createDiagnosticForNode(parameter, ...messageAndArgs);
|
|
@@ -79040,11 +78998,11 @@ function createTypeChecker(host) {
|
|
|
79040
78998
|
}
|
|
79041
78999
|
return result;
|
|
79042
79000
|
function addImplementationSuccessElaboration(failed, diagnostic) {
|
|
79043
|
-
var
|
|
79001
|
+
var _a, _b;
|
|
79044
79002
|
const oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
79045
79003
|
const oldCandidateForArgumentArityError = candidateForArgumentArityError;
|
|
79046
79004
|
const oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
|
|
79047
|
-
const failedSignatureDeclarations = ((_b = (
|
|
79005
|
+
const failedSignatureDeclarations = ((_b = (_a = failed.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.declarations) || emptyArray;
|
|
79048
79006
|
const isOverload2 = failedSignatureDeclarations.length > 1;
|
|
79049
79007
|
const implDecl = isOverload2 ? find(failedSignatureDeclarations, (d) => isFunctionLikeDeclaration(d) && nodeIsPresent(d.body)) : void 0;
|
|
79050
79008
|
if (implDecl) {
|
|
@@ -79059,7 +79017,7 @@ function createTypeChecker(host) {
|
|
|
79059
79017
|
candidateForTypeArgumentError = oldCandidateForTypeArgumentError;
|
|
79060
79018
|
}
|
|
79061
79019
|
function chooseOverload(candidates2, relation, isSingleNonGenericCandidate2, signatureHelpTrailingComma2 = false) {
|
|
79062
|
-
var
|
|
79020
|
+
var _a, _b;
|
|
79063
79021
|
candidatesForArgumentError = void 0;
|
|
79064
79022
|
candidateForArgumentArityError = void 0;
|
|
79065
79023
|
candidateForTypeArgumentError = void 0;
|
|
@@ -79094,7 +79052,7 @@ function createTypeChecker(host) {
|
|
|
79094
79052
|
let checkCandidate;
|
|
79095
79053
|
let inferenceContext;
|
|
79096
79054
|
if (candidate.typeParameters) {
|
|
79097
|
-
const paramLocation = (_b = (
|
|
79055
|
+
const paramLocation = (_b = (_a = candidate.typeParameters[0].symbol.declarations) == null ? void 0 : _a[0]) == null ? void 0 : _b.parent;
|
|
79098
79056
|
const candidateParameterContext = paramLocation || (candidate.declaration && isConstructorDeclaration(candidate.declaration) ? candidate.declaration.parent : candidate.declaration);
|
|
79099
79057
|
if (candidateParameterContext && findAncestor(node, (a) => a === candidateParameterContext)) {
|
|
79100
79058
|
candidate = getImplementationSignature(candidate);
|
|
@@ -79783,7 +79741,7 @@ function createTypeChecker(host) {
|
|
|
79783
79741
|
return result;
|
|
79784
79742
|
}
|
|
79785
79743
|
function isJSConstructor(node) {
|
|
79786
|
-
var
|
|
79744
|
+
var _a;
|
|
79787
79745
|
if (!node || !isInJSFile(node)) {
|
|
79788
79746
|
return false;
|
|
79789
79747
|
}
|
|
@@ -79794,12 +79752,12 @@ function createTypeChecker(host) {
|
|
|
79794
79752
|
if (isPropertyAssignment(walkUpParenthesizedExpressions(func.parent)))
|
|
79795
79753
|
return false;
|
|
79796
79754
|
const symbol = getSymbolOfDeclaration(func);
|
|
79797
|
-
return !!((
|
|
79755
|
+
return !!((_a = symbol == null ? void 0 : symbol.members) == null ? void 0 : _a.size);
|
|
79798
79756
|
}
|
|
79799
79757
|
return false;
|
|
79800
79758
|
}
|
|
79801
79759
|
function mergeJSSymbols(target, source) {
|
|
79802
|
-
var
|
|
79760
|
+
var _a, _b;
|
|
79803
79761
|
if (source) {
|
|
79804
79762
|
const links = getSymbolLinks(source);
|
|
79805
79763
|
if (!links.inferredClassSymbol || !links.inferredClassSymbol.has(getSymbolId(target))) {
|
|
@@ -79807,7 +79765,7 @@ function createTypeChecker(host) {
|
|
|
79807
79765
|
inferred.exports = inferred.exports || createSymbolTable();
|
|
79808
79766
|
inferred.members = inferred.members || createSymbolTable();
|
|
79809
79767
|
inferred.flags |= source.flags & 32 /* Class */;
|
|
79810
|
-
if ((
|
|
79768
|
+
if ((_a = source.exports) == null ? void 0 : _a.size) {
|
|
79811
79769
|
mergeSymbolTable(inferred.exports, source.exports);
|
|
79812
79770
|
}
|
|
79813
79771
|
if ((_b = source.members) == null ? void 0 : _b.size) {
|
|
@@ -79820,13 +79778,13 @@ function createTypeChecker(host) {
|
|
|
79820
79778
|
}
|
|
79821
79779
|
}
|
|
79822
79780
|
function getAssignedClassSymbol(decl) {
|
|
79823
|
-
var
|
|
79781
|
+
var _a;
|
|
79824
79782
|
const assignmentSymbol = decl && getSymbolOfExpando(
|
|
79825
79783
|
decl,
|
|
79826
79784
|
/*allowDeclaration*/
|
|
79827
79785
|
true
|
|
79828
79786
|
);
|
|
79829
|
-
const prototype = (
|
|
79787
|
+
const prototype = (_a = assignmentSymbol == null ? void 0 : assignmentSymbol.exports) == null ? void 0 : _a.get("prototype");
|
|
79830
79788
|
const init = (prototype == null ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration);
|
|
79831
79789
|
return init ? getSymbolOfDeclaration(init) : void 0;
|
|
79832
79790
|
}
|
|
@@ -79883,7 +79841,7 @@ function createTypeChecker(host) {
|
|
|
79883
79841
|
}
|
|
79884
79842
|
}
|
|
79885
79843
|
function checkCallExpression(node, checkMode) {
|
|
79886
|
-
var
|
|
79844
|
+
var _a, _b, _c;
|
|
79887
79845
|
checkGrammarTypeArguments(node, node.typeArguments);
|
|
79888
79846
|
const signature = getResolvedSignature(
|
|
79889
79847
|
node,
|
|
@@ -79900,7 +79858,7 @@ function createTypeChecker(host) {
|
|
|
79900
79858
|
}
|
|
79901
79859
|
if (node.kind === 214 /* NewExpression */) {
|
|
79902
79860
|
const declaration = signature.declaration;
|
|
79903
|
-
if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (
|
|
79861
|
+
if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a = getJSDocRoot(declaration)) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 176 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) {
|
|
79904
79862
|
if (noImplicitAny) {
|
|
79905
79863
|
error2(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
|
|
79906
79864
|
}
|
|
@@ -80059,11 +80017,11 @@ function createTypeChecker(host) {
|
|
|
80059
80017
|
return void 0;
|
|
80060
80018
|
}
|
|
80061
80019
|
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) {
|
|
80062
|
-
var
|
|
80020
|
+
var _a;
|
|
80063
80021
|
if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
|
|
80064
80022
|
const synthType = type;
|
|
80065
80023
|
if (!synthType.syntheticType) {
|
|
80066
|
-
const file = (
|
|
80024
|
+
const file = (_a = originalSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
80067
80025
|
const hasSyntheticDefault = canHaveSyntheticDefault(
|
|
80068
80026
|
file,
|
|
80069
80027
|
originalSymbol,
|
|
@@ -80397,8 +80355,8 @@ function createTypeChecker(host) {
|
|
|
80397
80355
|
return restParameter.escapedName;
|
|
80398
80356
|
}
|
|
80399
80357
|
function getParameterIdentifierInfoAtPosition(signature, pos) {
|
|
80400
|
-
var
|
|
80401
|
-
if (((
|
|
80358
|
+
var _a;
|
|
80359
|
+
if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 317 /* JSDocFunctionType */) {
|
|
80402
80360
|
return void 0;
|
|
80403
80361
|
}
|
|
80404
80362
|
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
@@ -81508,7 +81466,7 @@ function createTypeChecker(host) {
|
|
|
81508
81466
|
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));
|
|
81509
81467
|
}
|
|
81510
81468
|
function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) {
|
|
81511
|
-
var
|
|
81469
|
+
var _a, _b;
|
|
81512
81470
|
if (assignmentKind === 0 /* None */) {
|
|
81513
81471
|
return false;
|
|
81514
81472
|
}
|
|
@@ -81522,7 +81480,7 @@ function createTypeChecker(host) {
|
|
|
81522
81480
|
const isAssignmentDeclaration2 = isBinaryExpression(symbol.valueDeclaration);
|
|
81523
81481
|
const isLocalPropertyDeclaration = ctor.parent === symbol.valueDeclaration.parent;
|
|
81524
81482
|
const isLocalParameterProperty = ctor === symbol.valueDeclaration.parent;
|
|
81525
|
-
const isLocalThisPropertyAssignment = isAssignmentDeclaration2 && ((
|
|
81483
|
+
const isLocalThisPropertyAssignment = isAssignmentDeclaration2 && ((_a = symbol.parent) == null ? void 0 : _a.valueDeclaration) === ctor.parent;
|
|
81526
81484
|
const isLocalThisPropertyAssignmentConstructorFunction = isAssignmentDeclaration2 && ((_b = symbol.parent) == null ? void 0 : _b.valueDeclaration) === ctor;
|
|
81527
81485
|
const isWriteableSymbol = isLocalPropertyDeclaration || isLocalParameterProperty || isLocalThisPropertyAssignment || isLocalThisPropertyAssignmentConstructorFunction;
|
|
81528
81486
|
return !isWriteableSymbol;
|
|
@@ -81920,7 +81878,7 @@ function createTypeChecker(host) {
|
|
|
81920
81878
|
checkExternalEmitHelpers(node, 512 /* Read */);
|
|
81921
81879
|
}
|
|
81922
81880
|
const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType;
|
|
81923
|
-
let inBoundsType = noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType;
|
|
81881
|
+
let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType;
|
|
81924
81882
|
for (let i = 0; i < elements.length; i++) {
|
|
81925
81883
|
let type = possiblyOutOfBoundsType;
|
|
81926
81884
|
if (node.elements[i].kind === 230 /* SpreadElement */) {
|
|
@@ -82509,7 +82467,7 @@ function createTypeChecker(host) {
|
|
|
82509
82467
|
}
|
|
82510
82468
|
}
|
|
82511
82469
|
function isAssignmentDeclaration2(kind) {
|
|
82512
|
-
var
|
|
82470
|
+
var _a;
|
|
82513
82471
|
switch (kind) {
|
|
82514
82472
|
case 2 /* ModuleExports */:
|
|
82515
82473
|
return true;
|
|
@@ -82520,7 +82478,7 @@ function createTypeChecker(host) {
|
|
|
82520
82478
|
case 4 /* ThisProperty */:
|
|
82521
82479
|
const symbol = getSymbolOfNode(left);
|
|
82522
82480
|
const init = getAssignedExpandoInitializer(right);
|
|
82523
|
-
return !!init && isObjectLiteralExpression(init) && !!((
|
|
82481
|
+
return !!init && isObjectLiteralExpression(init) && !!((_a = symbol == null ? void 0 : symbol.exports) == null ? void 0 : _a.size);
|
|
82524
82482
|
default:
|
|
82525
82483
|
return false;
|
|
82526
82484
|
}
|
|
@@ -83070,8 +83028,8 @@ function createTypeChecker(host) {
|
|
|
83070
83028
|
return type;
|
|
83071
83029
|
}
|
|
83072
83030
|
function checkExpression(node, checkMode, forceTuple) {
|
|
83073
|
-
var
|
|
83074
|
-
(
|
|
83031
|
+
var _a, _b;
|
|
83032
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Check, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
83075
83033
|
const saveCurrentNode = currentNode;
|
|
83076
83034
|
currentNode = node;
|
|
83077
83035
|
instantiationCount = 0;
|
|
@@ -83246,7 +83204,7 @@ function createTypeChecker(host) {
|
|
|
83246
83204
|
addLazyDiagnostic(() => checkTypeNameIsReserved(node.name, Diagnostics.Type_parameter_name_cannot_be_0));
|
|
83247
83205
|
}
|
|
83248
83206
|
function checkTypeParameterDeferred(node) {
|
|
83249
|
-
var
|
|
83207
|
+
var _a, _b;
|
|
83250
83208
|
if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) {
|
|
83251
83209
|
const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node));
|
|
83252
83210
|
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
@@ -83255,7 +83213,7 @@ function createTypeChecker(host) {
|
|
|
83255
83213
|
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
83256
83214
|
error2(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
83257
83215
|
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
83258
|
-
(
|
|
83216
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
83259
83217
|
const source = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSubTypeForCheck : markerSuperTypeForCheck);
|
|
83260
83218
|
const target = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSuperTypeForCheck : markerSubTypeForCheck);
|
|
83261
83219
|
const saveVarianceTypeParameter = typeParameter;
|
|
@@ -83965,8 +83923,8 @@ function createTypeChecker(host) {
|
|
|
83965
83923
|
}
|
|
83966
83924
|
}
|
|
83967
83925
|
function checkGrammarMappedType(node) {
|
|
83968
|
-
var
|
|
83969
|
-
if ((
|
|
83926
|
+
var _a;
|
|
83927
|
+
if ((_a = node.members) == null ? void 0 : _a.length) {
|
|
83970
83928
|
return grammarErrorOnNode(node.members[0], Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);
|
|
83971
83929
|
}
|
|
83972
83930
|
}
|
|
@@ -84400,13 +84358,13 @@ function createTypeChecker(host) {
|
|
|
84400
84358
|
return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0;
|
|
84401
84359
|
}
|
|
84402
84360
|
function isAwaitedTypeInstantiation(type) {
|
|
84403
|
-
var
|
|
84361
|
+
var _a;
|
|
84404
84362
|
if (type.flags & 16777216 /* Conditional */) {
|
|
84405
84363
|
const awaitedSymbol = getGlobalAwaitedSymbol(
|
|
84406
84364
|
/*reportErrors*/
|
|
84407
84365
|
false
|
|
84408
84366
|
);
|
|
84409
|
-
return !!awaitedSymbol && type.aliasSymbol === awaitedSymbol && ((
|
|
84367
|
+
return !!awaitedSymbol && type.aliasSymbol === awaitedSymbol && ((_a = type.aliasTypeArguments) == null ? void 0 : _a.length) === 1;
|
|
84410
84368
|
}
|
|
84411
84369
|
return false;
|
|
84412
84370
|
}
|
|
@@ -84992,7 +84950,7 @@ function createTypeChecker(host) {
|
|
|
84992
84950
|
}
|
|
84993
84951
|
}
|
|
84994
84952
|
function checkFunctionOrMethodDeclaration(node) {
|
|
84995
|
-
var
|
|
84953
|
+
var _a;
|
|
84996
84954
|
checkDecorators(node);
|
|
84997
84955
|
checkSignatureDeclaration(node);
|
|
84998
84956
|
const functionFlags = getFunctionFlags(node);
|
|
@@ -85002,7 +84960,7 @@ function createTypeChecker(host) {
|
|
|
85002
84960
|
if (hasBindableName(node)) {
|
|
85003
84961
|
const symbol = getSymbolOfDeclaration(node);
|
|
85004
84962
|
const localSymbol = node.localSymbol || symbol;
|
|
85005
|
-
const firstDeclaration = (
|
|
84963
|
+
const firstDeclaration = (_a = localSymbol.declarations) == null ? void 0 : _a.find(
|
|
85006
84964
|
// Get first non javascript function declaration
|
|
85007
84965
|
(declaration) => declaration.kind === node.kind && !(declaration.flags & 524288 /* JavaScriptFile */)
|
|
85008
84966
|
);
|
|
@@ -85276,9 +85234,9 @@ function createTypeChecker(host) {
|
|
|
85276
85234
|
});
|
|
85277
85235
|
}
|
|
85278
85236
|
function checkPotentialUncheckedRenamedBindingElementsInTypes() {
|
|
85279
|
-
var
|
|
85237
|
+
var _a;
|
|
85280
85238
|
for (const node of potentialUnusedRenamedBindingElementsInTypes) {
|
|
85281
|
-
if (!((
|
|
85239
|
+
if (!((_a = getSymbolOfDeclaration(node)) == null ? void 0 : _a.isReferenced)) {
|
|
85282
85240
|
const wrappingDeclaration = walkUpBindingElementsAndPatterns(node);
|
|
85283
85241
|
Debug.assert(isPartOfParameterDeclaration(wrappingDeclaration), "Only parameter declaration should be checked here");
|
|
85284
85242
|
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));
|
|
@@ -85501,7 +85459,7 @@ function createTypeChecker(host) {
|
|
|
85501
85459
|
return type === autoType ? anyType : type === autoArrayType ? anyArrayType : type;
|
|
85502
85460
|
}
|
|
85503
85461
|
function checkVariableLikeDeclaration(node) {
|
|
85504
|
-
var
|
|
85462
|
+
var _a;
|
|
85505
85463
|
checkDecorators(node);
|
|
85506
85464
|
if (!isBindingElement(node)) {
|
|
85507
85465
|
checkSourceElement(node.type);
|
|
@@ -85600,7 +85558,7 @@ function createTypeChecker(host) {
|
|
|
85600
85558
|
if (node === symbol.valueDeclaration) {
|
|
85601
85559
|
const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node);
|
|
85602
85560
|
if (initializer) {
|
|
85603
|
-
const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((
|
|
85561
|
+
const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a = symbol.exports) == null ? void 0 : _a.size);
|
|
85604
85562
|
if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 249 /* ForInStatement */) {
|
|
85605
85563
|
const initializerType = checkExpressionCached(initializer);
|
|
85606
85564
|
checkTypeAssignableToAndOptionallyElaborate(
|
|
@@ -85695,8 +85653,8 @@ function createTypeChecker(host) {
|
|
|
85695
85653
|
return getSelectedEffectiveModifierFlags(left, interestingFlags) === getSelectedEffectiveModifierFlags(right, interestingFlags);
|
|
85696
85654
|
}
|
|
85697
85655
|
function checkVariableDeclaration(node) {
|
|
85698
|
-
var
|
|
85699
|
-
(
|
|
85656
|
+
var _a, _b;
|
|
85657
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Check, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
85700
85658
|
checkGrammarVariableDeclaration(node);
|
|
85701
85659
|
checkVariableLikeDeclaration(node);
|
|
85702
85660
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
@@ -85974,7 +85932,7 @@ function createTypeChecker(host) {
|
|
|
85974
85932
|
}
|
|
85975
85933
|
const uplevelIteration = languageVersion >= 2 /* ES2015 */;
|
|
85976
85934
|
const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
|
|
85977
|
-
const possibleOutOfBounds = noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */);
|
|
85935
|
+
const possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */);
|
|
85978
85936
|
if (uplevelIteration || downlevelIteration || allowAsyncIterables) {
|
|
85979
85937
|
const iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : void 0);
|
|
85980
85938
|
if (checkAssignability) {
|
|
@@ -86023,14 +85981,14 @@ function createTypeChecker(host) {
|
|
|
86023
85981
|
}
|
|
86024
85982
|
const arrayElementType = getIndexTypeOfType(arrayType, numberType);
|
|
86025
85983
|
if (hasStringConstituent && arrayElementType) {
|
|
86026
|
-
if (arrayElementType.flags & 402653316 /* StringLike */ && !noUncheckedIndexedAccess) {
|
|
85984
|
+
if (arrayElementType.flags & 402653316 /* StringLike */ && !compilerOptions.noUncheckedIndexedAccess) {
|
|
86027
85985
|
return stringType;
|
|
86028
85986
|
}
|
|
86029
85987
|
return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */);
|
|
86030
85988
|
}
|
|
86031
85989
|
return use & 128 /* PossiblyOutOfBounds */ ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType;
|
|
86032
85990
|
function getIterationDiagnosticDetails(allowsStrings, downlevelIteration2) {
|
|
86033
|
-
var
|
|
85991
|
+
var _a;
|
|
86034
85992
|
if (downlevelIteration2) {
|
|
86035
85993
|
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];
|
|
86036
85994
|
}
|
|
@@ -86044,7 +86002,7 @@ function createTypeChecker(host) {
|
|
|
86044
86002
|
if (yieldType) {
|
|
86045
86003
|
return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false];
|
|
86046
86004
|
}
|
|
86047
|
-
if (isES2015OrLaterIterable((
|
|
86005
|
+
if (isES2015OrLaterIterable((_a = inputType.symbol) == null ? void 0 : _a.escapedName)) {
|
|
86048
86006
|
return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, true];
|
|
86049
86007
|
}
|
|
86050
86008
|
return allowsStrings ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true] : [Diagnostics.Type_0_is_not_an_array_type, true];
|
|
@@ -86116,7 +86074,7 @@ function createTypeChecker(host) {
|
|
|
86116
86074
|
return type[cacheKey] = cachedTypes2;
|
|
86117
86075
|
}
|
|
86118
86076
|
function getIterationTypesOfIterable(type, use, errorNode) {
|
|
86119
|
-
var
|
|
86077
|
+
var _a, _b;
|
|
86120
86078
|
if (isTypeAny(type)) {
|
|
86121
86079
|
return anyIterationTypes;
|
|
86122
86080
|
}
|
|
@@ -86131,7 +86089,7 @@ function createTypeChecker(host) {
|
|
|
86131
86089
|
}
|
|
86132
86090
|
}
|
|
86133
86091
|
return void 0;
|
|
86134
|
-
} else if ((
|
|
86092
|
+
} else if ((_a = errorOutputContainer == null ? void 0 : errorOutputContainer.errors) == null ? void 0 : _a.length) {
|
|
86135
86093
|
for (const diag2 of errorOutputContainer.errors) {
|
|
86136
86094
|
diagnostics.add(diag2);
|
|
86137
86095
|
}
|
|
@@ -86439,7 +86397,7 @@ function createTypeChecker(host) {
|
|
|
86439
86397
|
));
|
|
86440
86398
|
}
|
|
86441
86399
|
function getIterationTypesOfMethod(type, resolver, methodName, errorNode, errorOutputContainer) {
|
|
86442
|
-
var
|
|
86400
|
+
var _a, _b, _c, _d;
|
|
86443
86401
|
const method = getPropertyOfType(type, methodName);
|
|
86444
86402
|
if (!method && methodName !== "next") {
|
|
86445
86403
|
return void 0;
|
|
@@ -86470,7 +86428,7 @@ function createTypeChecker(host) {
|
|
|
86470
86428
|
/*reportErrors*/
|
|
86471
86429
|
false
|
|
86472
86430
|
);
|
|
86473
|
-
const isGeneratorMethod = ((_b = (
|
|
86431
|
+
const isGeneratorMethod = ((_b = (_a = globalGeneratorType.symbol) == null ? void 0 : _a.members) == null ? void 0 : _b.get(methodName)) === methodType.symbol;
|
|
86474
86432
|
const isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) == null ? void 0 : _c.members) == null ? void 0 : _d.get(methodName)) === methodType.symbol;
|
|
86475
86433
|
if (isGeneratorMethod || isIteratorMethod) {
|
|
86476
86434
|
const globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType;
|
|
@@ -87342,7 +87300,7 @@ function createTypeChecker(host) {
|
|
|
87342
87300
|
return filter(symbol.declarations, (d) => d.kind === 263 /* ClassDeclaration */ || d.kind === 264 /* InterfaceDeclaration */);
|
|
87343
87301
|
}
|
|
87344
87302
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
87345
|
-
var
|
|
87303
|
+
var _a, _b, _c, _d, _e;
|
|
87346
87304
|
const baseProperties = getPropertiesOfType(baseType);
|
|
87347
87305
|
const notImplementedInfo = /* @__PURE__ */ new Map();
|
|
87348
87306
|
basePropertyCheck:
|
|
@@ -87373,7 +87331,7 @@ function createTypeChecker(host) {
|
|
|
87373
87331
|
const baseTypeName = typeToString(baseType);
|
|
87374
87332
|
const typeName = typeToString(type);
|
|
87375
87333
|
const basePropertyName = symbolToString(baseProperty);
|
|
87376
|
-
const missedProperties = append((
|
|
87334
|
+
const missedProperties = append((_a = notImplementedInfo.get(derivedClassDecl)) == null ? void 0 : _a.missedProperties, basePropertyName);
|
|
87377
87335
|
notImplementedInfo.set(derivedClassDecl, { baseTypeName, typeName, missedProperties });
|
|
87378
87336
|
}
|
|
87379
87337
|
} else {
|
|
@@ -87385,7 +87343,7 @@ function createTypeChecker(host) {
|
|
|
87385
87343
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
87386
87344
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
87387
87345
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
87388
|
-
if ((getCheckFlags(base) & 6 /*
|
|
87346
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_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)) {
|
|
87389
87347
|
continue;
|
|
87390
87348
|
}
|
|
87391
87349
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -87866,7 +87824,7 @@ function createTypeChecker(host) {
|
|
|
87866
87824
|
}
|
|
87867
87825
|
addLazyDiagnostic(checkModuleDeclarationDiagnostics);
|
|
87868
87826
|
function checkModuleDeclarationDiagnostics() {
|
|
87869
|
-
var
|
|
87827
|
+
var _a, _b;
|
|
87870
87828
|
const isGlobalAugmentation = isGlobalScopeAugmentation(node);
|
|
87871
87829
|
const inAmbientContext = node.flags & 33554432 /* Ambient */;
|
|
87872
87830
|
if (isGlobalAugmentation && !inAmbientContext) {
|
|
@@ -87891,7 +87849,7 @@ function createTypeChecker(host) {
|
|
|
87891
87849
|
if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) {
|
|
87892
87850
|
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);
|
|
87893
87851
|
}
|
|
87894
|
-
if (((
|
|
87852
|
+
if (((_a = symbol.declarations) == null ? void 0 : _a.length) > 1) {
|
|
87895
87853
|
const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
|
|
87896
87854
|
if (firstNonAmbientClassOrFunc) {
|
|
87897
87855
|
if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
|
@@ -88028,7 +87986,7 @@ function createTypeChecker(host) {
|
|
|
88028
87986
|
return true;
|
|
88029
87987
|
}
|
|
88030
87988
|
function checkAliasSymbol(node) {
|
|
88031
|
-
var
|
|
87989
|
+
var _a, _b, _c, _d;
|
|
88032
87990
|
let symbol = getSymbolOfDeclaration(node);
|
|
88033
87991
|
const target = resolveAlias(symbol);
|
|
88034
87992
|
if (target !== unknownSymbol) {
|
|
@@ -88038,7 +87996,7 @@ function createTypeChecker(host) {
|
|
|
88038
87996
|
Debug.assert(node.kind !== 280 /* NamespaceExport */);
|
|
88039
87997
|
if (node.kind === 281 /* ExportSpecifier */) {
|
|
88040
87998
|
const diag2 = error2(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
|
|
88041
|
-
const alreadyExportedSymbol = (_b = (
|
|
87999
|
+
const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get((node.propertyName || node.name).escapedText);
|
|
88042
88000
|
if (alreadyExportedSymbol === target) {
|
|
88043
88001
|
const exportingDeclaration = (_c = alreadyExportedSymbol.declarations) == null ? void 0 : _c.find(isJSDocNode);
|
|
88044
88002
|
if (exportingDeclaration) {
|
|
@@ -88165,7 +88123,7 @@ function createTypeChecker(host) {
|
|
|
88165
88123
|
}
|
|
88166
88124
|
}
|
|
88167
88125
|
function checkImportAttributes(declaration) {
|
|
88168
|
-
var
|
|
88126
|
+
var _a;
|
|
88169
88127
|
const node = declaration.attributes;
|
|
88170
88128
|
if (node) {
|
|
88171
88129
|
const importAttributesType = getGlobalImportAttributesType(
|
|
@@ -88186,7 +88144,7 @@ function createTypeChecker(host) {
|
|
|
88186
88144
|
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;
|
|
88187
88145
|
return grammarErrorOnNode(node, message);
|
|
88188
88146
|
}
|
|
88189
|
-
const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (
|
|
88147
|
+
const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly);
|
|
88190
88148
|
if (isTypeOnly) {
|
|
88191
88149
|
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);
|
|
88192
88150
|
}
|
|
@@ -88299,8 +88257,8 @@ function createTypeChecker(host) {
|
|
|
88299
88257
|
checkImportAttributes(node);
|
|
88300
88258
|
}
|
|
88301
88259
|
function checkGrammarExportDeclaration(node) {
|
|
88302
|
-
var
|
|
88303
|
-
if (node.isTypeOnly && ((
|
|
88260
|
+
var _a;
|
|
88261
|
+
if (node.isTypeOnly && ((_a = node.exportClause) == null ? void 0 : _a.kind) === 279 /* NamedExports */) {
|
|
88304
88262
|
return checkGrammarNamedImportsOrExports(node.exportClause);
|
|
88305
88263
|
}
|
|
88306
88264
|
return false;
|
|
@@ -88802,8 +88760,8 @@ function createTypeChecker(host) {
|
|
|
88802
88760
|
links.deferredNodes = void 0;
|
|
88803
88761
|
}
|
|
88804
88762
|
function checkDeferredNode(node) {
|
|
88805
|
-
var
|
|
88806
|
-
(
|
|
88763
|
+
var _a, _b;
|
|
88764
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Check, "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
88807
88765
|
const saveCurrentNode = currentNode;
|
|
88808
88766
|
currentNode = node;
|
|
88809
88767
|
instantiationCount = 0;
|
|
@@ -88855,8 +88813,8 @@ function createTypeChecker(host) {
|
|
|
88855
88813
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
88856
88814
|
}
|
|
88857
88815
|
function checkSourceFile(node) {
|
|
88858
|
-
var
|
|
88859
|
-
(
|
|
88816
|
+
var _a, _b;
|
|
88817
|
+
(_a = tracing) == null ? void 0 : _a.push(
|
|
88860
88818
|
tracing.Phase.Check,
|
|
88861
88819
|
"checkSourceFile",
|
|
88862
88820
|
{ path: node.path },
|
|
@@ -89650,7 +89608,7 @@ function createTypeChecker(host) {
|
|
|
89650
89608
|
return roots ? flatMap(roots, getRootSymbols) : [symbol];
|
|
89651
89609
|
}
|
|
89652
89610
|
function getImmediateRootSymbols(symbol) {
|
|
89653
|
-
if (getCheckFlags(symbol) & 6 /*
|
|
89611
|
+
if (getCheckFlags(symbol) & 6 /* Synthetic */) {
|
|
89654
89612
|
return mapDefined(getSymbolLinks(symbol).containingType.types, (type) => getPropertyOfType(type, symbol.escapedName));
|
|
89655
89613
|
} else if (symbol.flags & 33554432 /* Transient */) {
|
|
89656
89614
|
const { links: { leftSpread, rightSpread, syntheticOrigin } } = symbol;
|
|
@@ -89682,7 +89640,7 @@ function createTypeChecker(host) {
|
|
|
89682
89640
|
return isModuleOrEnumDeclaration(node.parent) && node === node.parent.name;
|
|
89683
89641
|
}
|
|
89684
89642
|
function getReferencedExportContainer(nodeIn, prefixLocals) {
|
|
89685
|
-
var
|
|
89643
|
+
var _a;
|
|
89686
89644
|
const node = getParseTreeNode(nodeIn, isIdentifier);
|
|
89687
89645
|
if (node) {
|
|
89688
89646
|
let symbol = getReferencedValueSymbol(
|
|
@@ -89700,7 +89658,7 @@ function createTypeChecker(host) {
|
|
|
89700
89658
|
}
|
|
89701
89659
|
const parentSymbol = getParentOfSymbol(symbol);
|
|
89702
89660
|
if (parentSymbol) {
|
|
89703
|
-
if (parentSymbol.flags & 512 /* ValueModule */ && ((
|
|
89661
|
+
if (parentSymbol.flags & 512 /* ValueModule */ && ((_a = parentSymbol.valueDeclaration) == null ? void 0 : _a.kind) === 307 /* SourceFile */) {
|
|
89704
89662
|
const symbolFile = parentSymbol.valueDeclaration;
|
|
89705
89663
|
const referenceFile = getSourceFileOfNode(node);
|
|
89706
89664
|
const symbolIsUmdExport = symbolFile !== referenceFile;
|
|
@@ -89927,11 +89885,11 @@ function createTypeChecker(host) {
|
|
|
89927
89885
|
return symbol && getPropertiesOfType(getTypeOfSymbol(symbol)) || emptyArray;
|
|
89928
89886
|
}
|
|
89929
89887
|
function getNodeCheckFlags(node) {
|
|
89930
|
-
var
|
|
89888
|
+
var _a;
|
|
89931
89889
|
const nodeId = node.id || 0;
|
|
89932
89890
|
if (nodeId < 0 || nodeId >= nodeLinks.length)
|
|
89933
89891
|
return 0;
|
|
89934
|
-
return ((
|
|
89892
|
+
return ((_a = nodeLinks[nodeId]) == null ? void 0 : _a.flags) || 0;
|
|
89935
89893
|
}
|
|
89936
89894
|
function getEnumMemberValue(node) {
|
|
89937
89895
|
computeEnumMemberValues(node.parent);
|
|
@@ -89966,7 +89924,7 @@ function createTypeChecker(host) {
|
|
|
89966
89924
|
return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0;
|
|
89967
89925
|
}
|
|
89968
89926
|
function getTypeReferenceSerializationKind(typeNameIn, location) {
|
|
89969
|
-
var
|
|
89927
|
+
var _a;
|
|
89970
89928
|
const typeName = getParseTreeNode(typeNameIn, isEntityName);
|
|
89971
89929
|
if (!typeName)
|
|
89972
89930
|
return 0 /* Unknown */;
|
|
@@ -89986,7 +89944,7 @@ function createTypeChecker(host) {
|
|
|
89986
89944
|
true,
|
|
89987
89945
|
location
|
|
89988
89946
|
);
|
|
89989
|
-
isTypeOnly = !!((
|
|
89947
|
+
isTypeOnly = !!((_a = rootValueSymbol == null ? void 0 : rootValueSymbol.declarations) == null ? void 0 : _a.every(isTypeOnlyImportOrExportDeclaration));
|
|
89990
89948
|
}
|
|
89991
89949
|
const valueSymbol = resolveEntityName(
|
|
89992
89950
|
typeName,
|
|
@@ -90698,7 +90656,7 @@ function createTypeChecker(host) {
|
|
|
90698
90656
|
return externalHelpersModule;
|
|
90699
90657
|
}
|
|
90700
90658
|
function checkGrammarModifiers(node) {
|
|
90701
|
-
var
|
|
90659
|
+
var _a;
|
|
90702
90660
|
const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node);
|
|
90703
90661
|
if (quickResult !== void 0) {
|
|
90704
90662
|
return quickResult;
|
|
@@ -90974,7 +90932,7 @@ function createTypeChecker(host) {
|
|
|
90974
90932
|
case 147 /* OutKeyword */: {
|
|
90975
90933
|
const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
|
|
90976
90934
|
const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
|
|
90977
|
-
const parent2 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((
|
|
90935
|
+
const parent2 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((_a = getJSDocRoot(node.parent)) == null ? void 0 : _a.tags, isJSDocTypedefTag)) || node.parent;
|
|
90978
90936
|
if (node.kind !== 168 /* TypeParameter */ || parent2 && !(isInterfaceDeclaration(parent2) || isClassLike(parent2) || isTypeAliasDeclaration(parent2) || isJSDocTypedefTag(parent2))) {
|
|
90979
90937
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
|
|
90980
90938
|
}
|
|
@@ -92051,11 +92009,11 @@ function createTypeChecker(host) {
|
|
|
92051
92009
|
return ambientModulesCache;
|
|
92052
92010
|
}
|
|
92053
92011
|
function checkGrammarImportClause(node) {
|
|
92054
|
-
var
|
|
92012
|
+
var _a;
|
|
92055
92013
|
if (node.isTypeOnly && node.name && node.namedBindings) {
|
|
92056
92014
|
return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
|
|
92057
92015
|
}
|
|
92058
|
-
if (node.isTypeOnly && ((
|
|
92016
|
+
if (node.isTypeOnly && ((_a = node.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamedImports */) {
|
|
92059
92017
|
return checkGrammarNamedImportsOrExports(node.namedBindings);
|
|
92060
92018
|
}
|
|
92061
92019
|
return false;
|
|
@@ -126935,9 +126893,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126935
126893
|
message = Diagnostics.File_is_library_specified_here;
|
|
126936
126894
|
break;
|
|
126937
126895
|
}
|
|
126938
|
-
const target = getEmitScriptTarget(options);
|
|
126939
|
-
|
|
126940
|
-
configFileNode = target === 2 /* ES2015 */ ? getOptionsSyntaxByValue("target", "es2015") ?? getOptionsSyntaxByValue("target", "es6") : targetText ? getOptionsSyntaxByValue("target", targetText) : void 0;
|
|
126896
|
+
const target = getNameOfScriptTarget(getEmitScriptTarget(options));
|
|
126897
|
+
configFileNode = target ? getOptionsSyntaxByValue("target", target) : void 0;
|
|
126941
126898
|
message = Diagnostics.File_is_default_library_for_target_specified_here;
|
|
126942
126899
|
break;
|
|
126943
126900
|
default:
|
|
@@ -145662,7 +145619,7 @@ function getSymbolForContextualType(node, checker) {
|
|
|
145662
145619
|
if (element) {
|
|
145663
145620
|
const contextualType = checker.getContextualTypeForObjectLiteralElement(element);
|
|
145664
145621
|
const symbol = contextualType == null ? void 0 : contextualType.getSymbol();
|
|
145665
|
-
if (symbol && !(getCheckFlags(symbol) & 6 /*
|
|
145622
|
+
if (symbol && !(getCheckFlags(symbol) & 6 /* Synthetic */)) {
|
|
145666
145623
|
return symbol;
|
|
145667
145624
|
}
|
|
145668
145625
|
}
|
|
@@ -149315,7 +149272,7 @@ var invalidOperationsInSyntacticMode = [
|
|
|
149315
149272
|
"findRenameLocations",
|
|
149316
149273
|
"getApplicableRefactors"
|
|
149317
149274
|
];
|
|
149318
|
-
function createLanguageService(host, documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()), syntaxOnlyOrLanguageServiceMode) {
|
|
149275
|
+
function createLanguageService(host, documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory(), host.jsDocParsingMode), syntaxOnlyOrLanguageServiceMode) {
|
|
149319
149276
|
var _a;
|
|
149320
149277
|
let languageServiceMode;
|
|
149321
149278
|
if (syntaxOnlyOrLanguageServiceMode === void 0) {
|
|
@@ -170385,7 +170342,7 @@ var Core;
|
|
|
170385
170342
|
baseSymbol = void 0;
|
|
170386
170343
|
}
|
|
170387
170344
|
}
|
|
170388
|
-
return search.includes(baseSymbol || rootSymbol || sym) ? { symbol: rootSymbol && !(getCheckFlags(sym) & 6 /*
|
|
170345
|
+
return search.includes(baseSymbol || rootSymbol || sym) ? { symbol: rootSymbol && !(getCheckFlags(sym) & 6 /* Synthetic */) ? rootSymbol : sym, kind } : void 0;
|
|
170389
170346
|
},
|
|
170390
170347
|
/*allowBaseTypes*/
|
|
170391
170348
|
(rootSymbol) => !(search.parents && !search.parents.some((parent2) => explicitlyInheritsFrom(rootSymbol.parent, parent2, state.inheritsFromCache, checker)))
|
|
@@ -174210,7 +174167,7 @@ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeCheck
|
|
|
174210
174167
|
if (flags & 131072 /* Signature */)
|
|
174211
174168
|
return "index" /* indexSignatureElement */;
|
|
174212
174169
|
if (flags & 4 /* Property */) {
|
|
174213
|
-
if (flags & 33554432 /* Transient */ && symbol.links.checkFlags & 6 /*
|
|
174170
|
+
if (flags & 33554432 /* Transient */ && symbol.links.checkFlags & 6 /* Synthetic */) {
|
|
174214
174171
|
const unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), (rootSymbol) => {
|
|
174215
174172
|
const rootSymbolFlags = rootSymbol.getFlags();
|
|
174216
174173
|
if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) {
|
|
@@ -174238,8 +174195,6 @@ function getNormalizedSymbolModifiers(symbol) {
|
|
|
174238
174195
|
if (modifiers) {
|
|
174239
174196
|
return modifiers.split(",");
|
|
174240
174197
|
}
|
|
174241
|
-
} else if (symbol.flags & 64 /* Interface */) {
|
|
174242
|
-
return ["declare" /* ambientModifier */];
|
|
174243
174198
|
}
|
|
174244
174199
|
return [];
|
|
174245
174200
|
}
|
|
@@ -178941,6 +178896,7 @@ __export(ts_exports2, {
|
|
|
178941
178896
|
InlayHints: () => ts_InlayHints_exports,
|
|
178942
178897
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
178943
178898
|
InternalSymbolName: () => InternalSymbolName,
|
|
178899
|
+
IntersectionFlags: () => IntersectionFlags,
|
|
178944
178900
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
178945
178901
|
JSDocParsingMode: () => JSDocParsingMode,
|
|
178946
178902
|
JsDoc: () => ts_JsDoc_exports,
|
|
@@ -179761,8 +179717,6 @@ __export(ts_exports2, {
|
|
|
179761
179717
|
getNameOfDeclaration: () => getNameOfDeclaration,
|
|
179762
179718
|
getNameOfExpando: () => getNameOfExpando,
|
|
179763
179719
|
getNameOfJSDocTypedef: () => getNameOfJSDocTypedef,
|
|
179764
|
-
getNameOfModuleKind: () => getNameOfModuleKind,
|
|
179765
|
-
getNameOfModuleResolutionKind: () => getNameOfModuleResolutionKind,
|
|
179766
179720
|
getNameOfScriptTarget: () => getNameOfScriptTarget,
|
|
179767
179721
|
getNameOrArgument: () => getNameOrArgument,
|
|
179768
179722
|
getNameTable: () => getNameTable,
|
|
@@ -180771,7 +180725,6 @@ __export(ts_exports2, {
|
|
|
180771
180725
|
moduleOptionDeclaration: () => moduleOptionDeclaration,
|
|
180772
180726
|
moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo,
|
|
180773
180727
|
moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter,
|
|
180774
|
-
moduleResolutionOptionDeclaration: () => moduleResolutionOptionDeclaration,
|
|
180775
180728
|
moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations,
|
|
180776
180729
|
moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports,
|
|
180777
180730
|
moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
|
|
@@ -193373,6 +193326,7 @@ if (typeof console !== "undefined") {
|
|
|
193373
193326
|
InlayHints,
|
|
193374
193327
|
InternalEmitFlags,
|
|
193375
193328
|
InternalSymbolName,
|
|
193329
|
+
IntersectionFlags,
|
|
193376
193330
|
InvalidatedProjectKind,
|
|
193377
193331
|
JSDocParsingMode,
|
|
193378
193332
|
JsDoc,
|
|
@@ -194193,8 +194147,6 @@ if (typeof console !== "undefined") {
|
|
|
194193
194147
|
getNameOfDeclaration,
|
|
194194
194148
|
getNameOfExpando,
|
|
194195
194149
|
getNameOfJSDocTypedef,
|
|
194196
|
-
getNameOfModuleKind,
|
|
194197
|
-
getNameOfModuleResolutionKind,
|
|
194198
194150
|
getNameOfScriptTarget,
|
|
194199
194151
|
getNameOrArgument,
|
|
194200
194152
|
getNameTable,
|
|
@@ -195203,7 +195155,6 @@ if (typeof console !== "undefined") {
|
|
|
195203
195155
|
moduleOptionDeclaration,
|
|
195204
195156
|
moduleResolutionIsEqualTo,
|
|
195205
195157
|
moduleResolutionNameAndModeGetter,
|
|
195206
|
-
moduleResolutionOptionDeclaration,
|
|
195207
195158
|
moduleResolutionOptionDeclarations,
|
|
195208
195159
|
moduleResolutionSupportsPackageJsonExportsAndImports,
|
|
195209
195160
|
moduleResolutionUsesNodeModules,
|