typescript 5.1.0-dev.20230315 → 5.1.0-dev.20230317
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 +88 -76
- package/lib/tsserver.js +116 -100
- package/lib/tsserverlibrary.js +113 -99
- package/lib/typescript.js +89 -78
- package/lib/typingsInstaller.js +13 -34
- package/package.json +3 -3
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230317`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3081,40 +3081,17 @@ ${lanes.join("\n")}
|
|
|
3081
3081
|
});
|
|
3082
3082
|
|
|
3083
3083
|
// src/compiler/perfLogger.ts
|
|
3084
|
-
var
|
|
3084
|
+
var etwModule, _a, perfLogger;
|
|
3085
3085
|
var init_perfLogger = __esm({
|
|
3086
3086
|
"src/compiler/perfLogger.ts"() {
|
|
3087
3087
|
"use strict";
|
|
3088
|
-
init_ts2();
|
|
3089
|
-
nullLogger = {
|
|
3090
|
-
logEvent: noop,
|
|
3091
|
-
logErrEvent: noop,
|
|
3092
|
-
logPerfEvent: noop,
|
|
3093
|
-
logInfoEvent: noop,
|
|
3094
|
-
logStartCommand: noop,
|
|
3095
|
-
logStopCommand: noop,
|
|
3096
|
-
logStartUpdateProgram: noop,
|
|
3097
|
-
logStopUpdateProgram: noop,
|
|
3098
|
-
logStartUpdateGraph: noop,
|
|
3099
|
-
logStopUpdateGraph: noop,
|
|
3100
|
-
logStartResolveModule: noop,
|
|
3101
|
-
logStopResolveModule: noop,
|
|
3102
|
-
logStartParseSourceFile: noop,
|
|
3103
|
-
logStopParseSourceFile: noop,
|
|
3104
|
-
logStartReadFile: noop,
|
|
3105
|
-
logStopReadFile: noop,
|
|
3106
|
-
logStartBindFile: noop,
|
|
3107
|
-
logStopBindFile: noop,
|
|
3108
|
-
logStartScheduledOperation: noop,
|
|
3109
|
-
logStopScheduledOperation: noop
|
|
3110
|
-
};
|
|
3111
3088
|
try {
|
|
3112
3089
|
const etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) != null ? _a : "./node_modules/@microsoft/typescript-etw";
|
|
3113
3090
|
etwModule = require(etwModulePath);
|
|
3114
3091
|
} catch (e) {
|
|
3115
3092
|
etwModule = void 0;
|
|
3116
3093
|
}
|
|
3117
|
-
perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule :
|
|
3094
|
+
perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule : void 0;
|
|
3118
3095
|
}
|
|
3119
3096
|
});
|
|
3120
3097
|
|
|
@@ -6428,13 +6405,15 @@ ${lanes.join("\n")}
|
|
|
6428
6405
|
return buffer.toString("utf8");
|
|
6429
6406
|
}
|
|
6430
6407
|
function readFile(fileName, _encoding) {
|
|
6431
|
-
|
|
6408
|
+
var _a2, _b;
|
|
6409
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartReadFile(fileName);
|
|
6432
6410
|
const file = readFileWorker(fileName, _encoding);
|
|
6433
|
-
perfLogger.logStopReadFile();
|
|
6411
|
+
(_b = perfLogger) == null ? void 0 : _b.logStopReadFile();
|
|
6434
6412
|
return file;
|
|
6435
6413
|
}
|
|
6436
6414
|
function writeFile2(fileName, data, writeByteOrderMark) {
|
|
6437
|
-
|
|
6415
|
+
var _a2;
|
|
6416
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logEvent("WriteFile: " + fileName);
|
|
6438
6417
|
if (writeByteOrderMark) {
|
|
6439
6418
|
data = byteOrderMarkIndicator + data;
|
|
6440
6419
|
}
|
|
@@ -6455,7 +6434,8 @@ ${lanes.join("\n")}
|
|
|
6455
6434
|
}
|
|
6456
6435
|
}
|
|
6457
6436
|
function getAccessibleFileSystemEntries(path) {
|
|
6458
|
-
|
|
6437
|
+
var _a2;
|
|
6438
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logEvent("ReadDir: " + (path || "."));
|
|
6459
6439
|
try {
|
|
6460
6440
|
const entries = _fs.readdirSync(path || ".", { withFileTypes: true });
|
|
6461
6441
|
const files = [];
|
|
@@ -27727,7 +27707,7 @@ ${lanes.join("\n")}
|
|
|
27727
27707
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
27728
27708
|
}
|
|
27729
27709
|
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
27730
|
-
var _a2, _b;
|
|
27710
|
+
var _a2, _b, _c, _d;
|
|
27731
27711
|
(_a2 = tracing) == null ? void 0 : _a2.push(
|
|
27732
27712
|
tracing.Phase.Parse,
|
|
27733
27713
|
"createSourceFile",
|
|
@@ -27737,7 +27717,7 @@ ${lanes.join("\n")}
|
|
|
27737
27717
|
);
|
|
27738
27718
|
mark("beforeParse");
|
|
27739
27719
|
let result;
|
|
27740
|
-
perfLogger.logStartParseSourceFile(fileName);
|
|
27720
|
+
(_b = perfLogger) == null ? void 0 : _b.logStartParseSourceFile(fileName);
|
|
27741
27721
|
const {
|
|
27742
27722
|
languageVersion,
|
|
27743
27723
|
setExternalModuleIndicator: overrideSetExternalModuleIndicator,
|
|
@@ -27770,10 +27750,10 @@ ${lanes.join("\n")}
|
|
|
27770
27750
|
setIndicator
|
|
27771
27751
|
);
|
|
27772
27752
|
}
|
|
27773
|
-
perfLogger.logStopParseSourceFile();
|
|
27753
|
+
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
27774
27754
|
mark("afterParse");
|
|
27775
27755
|
measure("Parse", "beforeParse", "afterParse");
|
|
27776
|
-
(
|
|
27756
|
+
(_d = tracing) == null ? void 0 : _d.pop();
|
|
27777
27757
|
return result;
|
|
27778
27758
|
}
|
|
27779
27759
|
function parseIsolatedEntityName(text, languageVersion) {
|
|
@@ -39498,6 +39478,7 @@ ${lanes.join("\n")}
|
|
|
39498
39478
|
);
|
|
39499
39479
|
}
|
|
39500
39480
|
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
39481
|
+
var _a2, _b, _c;
|
|
39501
39482
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
39502
39483
|
if (redirectedReference) {
|
|
39503
39484
|
compilerOptions = redirectedReference.commandLine.options;
|
|
@@ -39539,10 +39520,7 @@ ${lanes.join("\n")}
|
|
|
39539
39520
|
trace(host, Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ModuleResolutionKind[moduleResolution]);
|
|
39540
39521
|
}
|
|
39541
39522
|
}
|
|
39542
|
-
perfLogger.logStartResolveModule(
|
|
39543
|
-
moduleName
|
|
39544
|
-
/* , containingFile, ModuleResolutionKind[moduleResolution]*/
|
|
39545
|
-
);
|
|
39523
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartResolveModule(moduleName);
|
|
39546
39524
|
switch (moduleResolution) {
|
|
39547
39525
|
case 3 /* Node16 */:
|
|
39548
39526
|
result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -39563,8 +39541,8 @@ ${lanes.join("\n")}
|
|
|
39563
39541
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
39564
39542
|
}
|
|
39565
39543
|
if (result && result.resolvedModule)
|
|
39566
|
-
perfLogger.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
39567
|
-
perfLogger.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
39544
|
+
(_b = perfLogger) == null ? void 0 : _b.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
39545
|
+
(_c = perfLogger) == null ? void 0 : _c.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
39568
39546
|
cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
|
|
39569
39547
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
39570
39548
|
cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
@@ -41336,10 +41314,11 @@ ${lanes.join("\n")}
|
|
|
41336
41314
|
return node;
|
|
41337
41315
|
}
|
|
41338
41316
|
function bindSourceFile(file, options) {
|
|
41317
|
+
var _a2, _b;
|
|
41339
41318
|
mark("beforeBind");
|
|
41340
|
-
perfLogger.logStartBindFile("" + file.fileName);
|
|
41319
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartBindFile("" + file.fileName);
|
|
41341
41320
|
binder(file, options);
|
|
41342
|
-
perfLogger.logStopBindFile();
|
|
41321
|
+
(_b = perfLogger) == null ? void 0 : _b.logStopBindFile();
|
|
41343
41322
|
mark("afterBind");
|
|
41344
41323
|
measure("Bind", "beforeBind", "afterBind");
|
|
41345
41324
|
}
|
|
@@ -48377,6 +48356,10 @@ ${lanes.join("\n")}
|
|
|
48377
48356
|
return;
|
|
48378
48357
|
merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
|
|
48379
48358
|
});
|
|
48359
|
+
if (merged === exported) {
|
|
48360
|
+
getSymbolLinks(merged).resolvedExports = void 0;
|
|
48361
|
+
getSymbolLinks(merged).resolvedMembers = void 0;
|
|
48362
|
+
}
|
|
48380
48363
|
getSymbolLinks(merged).cjsExportMerged = merged;
|
|
48381
48364
|
return links.cjsExportMerged = merged;
|
|
48382
48365
|
}
|
|
@@ -48410,7 +48393,7 @@ ${lanes.join("\n")}
|
|
|
48410
48393
|
/*skipObjectFunctionPropertyAugment*/
|
|
48411
48394
|
true
|
|
48412
48395
|
) || isEsmCjsRef) {
|
|
48413
|
-
const moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
|
|
48396
|
+
const moduleType = type.flags & 3670016 /* StructuredType */ ? getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference) : createDefaultPropertyWrapperForModule(symbol, symbol.parent);
|
|
48414
48397
|
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
|
|
48415
48398
|
}
|
|
48416
48399
|
}
|
|
@@ -51830,7 +51813,8 @@ ${lanes.join("\n")}
|
|
|
51830
51813
|
), modifierFlags);
|
|
51831
51814
|
}
|
|
51832
51815
|
function getNamespaceMembersForSerialization(symbol) {
|
|
51833
|
-
|
|
51816
|
+
const exports = getExportsOfSymbol(symbol);
|
|
51817
|
+
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
51834
51818
|
}
|
|
51835
51819
|
function isTypeOnlyNamespace(symbol) {
|
|
51836
51820
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -55633,9 +55617,10 @@ ${lanes.join("\n")}
|
|
|
55633
55617
|
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
55634
55618
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
55635
55619
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
55636
|
-
const
|
|
55637
|
-
const
|
|
55638
|
-
const
|
|
55620
|
+
const mappedType = type.target || type;
|
|
55621
|
+
const nameType = getNameTypeFromMappedType(mappedType);
|
|
55622
|
+
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
|
|
55623
|
+
const templateType = getTemplateTypeFromMappedType(mappedType);
|
|
55639
55624
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
55640
55625
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
55641
55626
|
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
|
|
@@ -55672,7 +55657,7 @@ ${lanes.join("\n")}
|
|
|
55672
55657
|
prop.links.keyType = keyType;
|
|
55673
55658
|
if (modifiersProp) {
|
|
55674
55659
|
prop.links.syntheticOrigin = modifiersProp;
|
|
55675
|
-
prop.declarations =
|
|
55660
|
+
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
|
|
55676
55661
|
}
|
|
55677
55662
|
members.set(propName, prop);
|
|
55678
55663
|
}
|
|
@@ -55778,6 +55763,10 @@ ${lanes.join("\n")}
|
|
|
55778
55763
|
}
|
|
55779
55764
|
return false;
|
|
55780
55765
|
}
|
|
55766
|
+
function isFilteringMappedType(type) {
|
|
55767
|
+
const nameType = getNameTypeFromMappedType(type);
|
|
55768
|
+
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
|
|
55769
|
+
}
|
|
55781
55770
|
function resolveStructuredTypeMembers(type) {
|
|
55782
55771
|
if (!type.members) {
|
|
55783
55772
|
if (type.flags & 524288 /* Object */) {
|
|
@@ -56137,7 +56126,7 @@ ${lanes.join("\n")}
|
|
|
56137
56126
|
const typeVariable = getHomomorphicTypeVariable(type);
|
|
56138
56127
|
if (typeVariable && !type.declaration.nameType) {
|
|
56139
56128
|
const constraint = getConstraintOfTypeParameter(typeVariable);
|
|
56140
|
-
if (constraint &&
|
|
56129
|
+
if (constraint && isArrayType(constraint)) {
|
|
56141
56130
|
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
|
|
56142
56131
|
}
|
|
56143
56132
|
}
|
|
@@ -59317,8 +59306,7 @@ ${lanes.join("\n")}
|
|
|
59317
59306
|
}
|
|
59318
59307
|
}
|
|
59319
59308
|
if (isGenericMappedType(objectType)) {
|
|
59320
|
-
|
|
59321
|
-
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
59309
|
+
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
|
|
59322
59310
|
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
|
|
59323
59311
|
}
|
|
59324
59312
|
}
|
|
@@ -61054,8 +61042,20 @@ ${lanes.join("\n")}
|
|
|
61054
61042
|
return result;
|
|
61055
61043
|
}
|
|
61056
61044
|
const moreThanOneRealChildren = length(validChildren) > 1;
|
|
61057
|
-
|
|
61058
|
-
|
|
61045
|
+
let arrayLikeTargetParts;
|
|
61046
|
+
let nonArrayLikeTargetParts;
|
|
61047
|
+
const iterableType = getGlobalIterableType(
|
|
61048
|
+
/*reportErrors*/
|
|
61049
|
+
false
|
|
61050
|
+
);
|
|
61051
|
+
if (iterableType !== emptyGenericType) {
|
|
61052
|
+
const anyIterable = createIterableType(anyType);
|
|
61053
|
+
arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable));
|
|
61054
|
+
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable));
|
|
61055
|
+
} else {
|
|
61056
|
+
arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);
|
|
61057
|
+
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t));
|
|
61058
|
+
}
|
|
61059
61059
|
if (moreThanOneRealChildren) {
|
|
61060
61060
|
if (arrayLikeTargetParts !== neverType) {
|
|
61061
61061
|
const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));
|
|
@@ -64335,13 +64335,6 @@ ${lanes.join("\n")}
|
|
|
64335
64335
|
function isArrayOrTupleLikeType(type) {
|
|
64336
64336
|
return isArrayLikeType(type) || isTupleLikeType(type);
|
|
64337
64337
|
}
|
|
64338
|
-
function isAssignableToAvailableAnyIterable(type) {
|
|
64339
|
-
const anyIterable = getGlobalIterableType(
|
|
64340
|
-
/*reportErrors*/
|
|
64341
|
-
false
|
|
64342
|
-
) !== emptyGenericType && createIterableType(anyType);
|
|
64343
|
-
return anyIterable ? isTypeAssignableTo(type, anyIterable) : isArrayOrTupleLikeType(type);
|
|
64344
|
-
}
|
|
64345
64338
|
function getTupleElementType(type, index) {
|
|
64346
64339
|
const propType = getTypeOfPropertyOfType(type, "" + index);
|
|
64347
64340
|
if (propType) {
|
|
@@ -68939,7 +68932,7 @@ ${lanes.join("\n")}
|
|
|
68939
68932
|
return void 0;
|
|
68940
68933
|
}
|
|
68941
68934
|
}
|
|
68942
|
-
return isInJSFile(decl2) ? void 0 : getTypeOfExpression(binaryExpression.left);
|
|
68935
|
+
return isInJSFile(decl2) || decl2 === binaryExpression.left ? void 0 : getTypeOfExpression(binaryExpression.left);
|
|
68943
68936
|
}
|
|
68944
68937
|
case 1 /* ExportsProperty */:
|
|
68945
68938
|
case 6 /* Prototype */:
|
|
@@ -69095,7 +69088,7 @@ ${lanes.join("\n")}
|
|
|
69095
69088
|
return void 0;
|
|
69096
69089
|
}
|
|
69097
69090
|
function getContextualTypeForElementExpression(arrayContextualType, index) {
|
|
69098
|
-
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(
|
|
69091
|
+
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
69099
69092
|
arrayContextualType,
|
|
69100
69093
|
(t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType(
|
|
69101
69094
|
t,
|
|
@@ -69837,7 +69830,7 @@ ${lanes.join("\n")}
|
|
|
69837
69830
|
const inConstContext = isConstContext(node);
|
|
69838
69831
|
const checkFlags = inConstContext ? 8 /* Readonly */ : 0;
|
|
69839
69832
|
const isInJavascript = isInJSFile(node) && !isInJsonFile(node);
|
|
69840
|
-
const enumTag = getJSDocEnumTag(node);
|
|
69833
|
+
const enumTag = isInJavascript ? getJSDocEnumTag(node) : void 0;
|
|
69841
69834
|
const isJSObjectLiteral = !contextualType && isInJavascript && !enumTag;
|
|
69842
69835
|
let objectFlags = freshObjectLiteralFlag;
|
|
69843
69836
|
let patternWithComputedProperties = false;
|
|
@@ -70063,7 +70056,7 @@ ${lanes.join("\n")}
|
|
|
70063
70056
|
}
|
|
70064
70057
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
70065
70058
|
const attributes = openingLikeElement.attributes;
|
|
70066
|
-
const
|
|
70059
|
+
const contextualType = getContextualType2(attributes, 0 /* None */);
|
|
70067
70060
|
const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
70068
70061
|
let attributesTable = createSymbolTable();
|
|
70069
70062
|
let spread = emptyJsxObjectType;
|
|
@@ -70090,12 +70083,18 @@ ${lanes.join("\n")}
|
|
|
70090
70083
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
70091
70084
|
explicitlySpecifyChildrenAttribute = true;
|
|
70092
70085
|
}
|
|
70093
|
-
if (
|
|
70094
|
-
const prop = getPropertyOfType(
|
|
70086
|
+
if (contextualType) {
|
|
70087
|
+
const prop = getPropertyOfType(contextualType, member.escapedName);
|
|
70095
70088
|
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
70096
70089
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
70097
70090
|
}
|
|
70098
70091
|
}
|
|
70092
|
+
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
|
|
70093
|
+
const inferenceContext = getInferenceContext(attributes);
|
|
70094
|
+
Debug.assert(inferenceContext);
|
|
70095
|
+
const inferenceNode = attributeDecl.initializer.expression;
|
|
70096
|
+
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType);
|
|
70097
|
+
}
|
|
70099
70098
|
} else {
|
|
70100
70099
|
Debug.assert(attributeDecl.kind === 291 /* JsxSpreadAttribute */);
|
|
70101
70100
|
if (attributesTable.size > 0) {
|
|
@@ -70150,12 +70149,12 @@ ${lanes.join("\n")}
|
|
|
70150
70149
|
if (explicitlySpecifyChildrenAttribute) {
|
|
70151
70150
|
error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName));
|
|
70152
70151
|
}
|
|
70153
|
-
const
|
|
70152
|
+
const contextualType2 = getApparentTypeOfContextualType(
|
|
70154
70153
|
openingLikeElement.attributes,
|
|
70155
70154
|
/*contextFlags*/
|
|
70156
70155
|
void 0
|
|
70157
70156
|
);
|
|
70158
|
-
const childrenContextualType =
|
|
70157
|
+
const childrenContextualType = contextualType2 && getTypeOfPropertyOfContextualType(contextualType2, jsxChildrenPropertyName);
|
|
70159
70158
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
70160
70159
|
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
70161
70160
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(
|
|
@@ -74588,6 +74587,11 @@ ${lanes.join("\n")}
|
|
|
74588
74587
|
} else {
|
|
74589
74588
|
assignNonContextualParameterTypes(signature);
|
|
74590
74589
|
}
|
|
74590
|
+
} else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) {
|
|
74591
|
+
const inferenceContext = getInferenceContext(node);
|
|
74592
|
+
if (checkMode && checkMode & 2 /* Inferential */) {
|
|
74593
|
+
inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
|
|
74594
|
+
}
|
|
74591
74595
|
}
|
|
74592
74596
|
if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
|
|
74593
74597
|
const returnType = getReturnTypeFromBody(node, checkMode);
|
|
@@ -93911,8 +93915,11 @@ ${lanes.join("\n")}
|
|
|
93911
93915
|
false,
|
|
93912
93916
|
visitor
|
|
93913
93917
|
);
|
|
93918
|
+
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
93919
|
+
const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0;
|
|
93920
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0));
|
|
93914
93921
|
addRange(statements, initializerStatements);
|
|
93915
|
-
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement,
|
|
93922
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper));
|
|
93916
93923
|
body = factory2.createBlock(
|
|
93917
93924
|
statements,
|
|
93918
93925
|
/*multiLine*/
|
|
@@ -106802,7 +106809,7 @@ ${lanes.join("\n")}
|
|
|
106802
106809
|
|
|
106803
106810
|
// src/compiler/transformers/declarations/diagnostics.ts
|
|
106804
106811
|
function canProduceDiagnostics(node) {
|
|
106805
|
-
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
|
|
106812
|
+
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
|
|
106806
106813
|
}
|
|
106807
106814
|
function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
106808
106815
|
if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
@@ -106848,7 +106855,7 @@ ${lanes.join("\n")}
|
|
|
106848
106855
|
}
|
|
106849
106856
|
}
|
|
106850
106857
|
function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
106851
|
-
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
106858
|
+
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
106852
106859
|
return getVariableDeclarationTypeVisibilityError;
|
|
106853
106860
|
} else if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
106854
106861
|
return getAccessorDeclarationTypeVisibilityError;
|
|
@@ -106873,7 +106880,7 @@ ${lanes.join("\n")}
|
|
|
106873
106880
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
106874
106881
|
if (node.kind === 258 /* VariableDeclaration */ || node.kind === 206 /* BindingElement */) {
|
|
106875
106882
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
106876
|
-
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
106883
|
+
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 210 /* ElementAccessExpression */ || node.kind === 224 /* BinaryExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
106877
106884
|
if (isStatic(node)) {
|
|
106878
106885
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
106879
106886
|
} else if (node.parent.kind === 261 /* ClassDeclaration */ || node.kind === 167 /* Parameter */) {
|
|
@@ -108331,13 +108338,16 @@ ${lanes.join("\n")}
|
|
|
108331
108338
|
fakespace.symbol = props[0].parent;
|
|
108332
108339
|
const exportMappings = [];
|
|
108333
108340
|
let declarations = mapDefined(props, (p) => {
|
|
108334
|
-
if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
|
|
108341
|
+
if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
|
|
108342
|
+
return void 0;
|
|
108343
|
+
}
|
|
108344
|
+
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
108345
|
+
if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
|
|
108335
108346
|
return void 0;
|
|
108336
108347
|
}
|
|
108337
108348
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
108338
108349
|
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
108339
108350
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
108340
|
-
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
108341
108351
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
108342
108352
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
108343
108353
|
if (isNonContextualKeywordName) {
|
|
@@ -122811,21 +122821,22 @@ ${lanes.join("\n")}
|
|
|
122811
122821
|
updateProgram();
|
|
122812
122822
|
}
|
|
122813
122823
|
function updateProgram() {
|
|
122824
|
+
var _a2, _b, _c, _d;
|
|
122814
122825
|
switch (reloadLevel) {
|
|
122815
122826
|
case 1 /* Partial */:
|
|
122816
|
-
perfLogger.logStartUpdateProgram("PartialConfigReload");
|
|
122827
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartUpdateProgram("PartialConfigReload");
|
|
122817
122828
|
reloadFileNamesFromConfigFile();
|
|
122818
122829
|
break;
|
|
122819
122830
|
case 2 /* Full */:
|
|
122820
|
-
perfLogger.logStartUpdateProgram("FullConfigReload");
|
|
122831
|
+
(_b = perfLogger) == null ? void 0 : _b.logStartUpdateProgram("FullConfigReload");
|
|
122821
122832
|
reloadConfigFile();
|
|
122822
122833
|
break;
|
|
122823
122834
|
default:
|
|
122824
|
-
perfLogger.logStartUpdateProgram("SynchronizeProgram");
|
|
122835
|
+
(_c = perfLogger) == null ? void 0 : _c.logStartUpdateProgram("SynchronizeProgram");
|
|
122825
122836
|
synchronizeProgram();
|
|
122826
122837
|
break;
|
|
122827
122838
|
}
|
|
122828
|
-
perfLogger.logStopUpdateProgram("Done");
|
|
122839
|
+
(_d = perfLogger) == null ? void 0 : _d.logStopUpdateProgram("Done");
|
|
122829
122840
|
return getCurrentBuilderProgram();
|
|
122830
122841
|
}
|
|
122831
122842
|
function reloadFileNamesFromConfigFile() {
|
|
@@ -167944,13 +167955,14 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
167944
167955
|
return this.pendingTimeouts.delete(operationId);
|
|
167945
167956
|
}
|
|
167946
167957
|
static run(self, operationId, cb) {
|
|
167947
|
-
|
|
167958
|
+
var _a2, _b;
|
|
167959
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartScheduledOperation(operationId);
|
|
167948
167960
|
self.pendingTimeouts.delete(operationId);
|
|
167949
167961
|
if (self.logger) {
|
|
167950
167962
|
self.logger.info(`Running: ${operationId}`);
|
|
167951
167963
|
}
|
|
167952
167964
|
cb();
|
|
167953
|
-
perfLogger.logStopScheduledOperation();
|
|
167965
|
+
(_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation();
|
|
167954
167966
|
}
|
|
167955
167967
|
};
|
|
167956
167968
|
GcTimer = class {
|
|
@@ -167966,8 +167978,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
167966
167978
|
this.timerId = this.host.setTimeout(GcTimer.run, this.delay, this);
|
|
167967
167979
|
}
|
|
167968
167980
|
static run(self) {
|
|
167981
|
+
var _a2, _b;
|
|
167969
167982
|
self.timerId = void 0;
|
|
167970
|
-
perfLogger.logStartScheduledOperation("GC collect");
|
|
167983
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logStartScheduledOperation("GC collect");
|
|
167971
167984
|
const log = self.logger.hasLevel(2 /* requestTime */);
|
|
167972
167985
|
const before = log && self.host.getMemoryUsage();
|
|
167973
167986
|
self.host.gc();
|
|
@@ -167975,7 +167988,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
167975
167988
|
const after = self.host.getMemoryUsage();
|
|
167976
167989
|
self.logger.perftrc(`GC::before ${before}, after ${after}`);
|
|
167977
167990
|
}
|
|
167978
|
-
perfLogger.logStopScheduledOperation();
|
|
167991
|
+
(_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation();
|
|
167979
167992
|
}
|
|
167980
167993
|
};
|
|
167981
167994
|
indentStr = "\n ";
|
|
@@ -169725,9 +169738,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
169725
169738
|
* @returns: true if set of files in the project stays the same and false - otherwise.
|
|
169726
169739
|
*/
|
|
169727
169740
|
updateGraph() {
|
|
169728
|
-
var _a2, _b, _c;
|
|
169741
|
+
var _a2, _b, _c, _d, _e;
|
|
169729
169742
|
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "updateGraph", { name: this.projectName, kind: ProjectKind[this.projectKind] });
|
|
169730
|
-
perfLogger.logStartUpdateGraph();
|
|
169743
|
+
(_b = perfLogger) == null ? void 0 : _b.logStartUpdateGraph();
|
|
169731
169744
|
this.resolutionCache.startRecordingFilesWithChangedResolutions();
|
|
169732
169745
|
const hasNewProgram = this.updateGraphWorker();
|
|
169733
169746
|
const hasAddedorRemovedFiles = this.hasAddedorRemovedFiles;
|
|
@@ -169752,13 +169765,13 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
169752
169765
|
if (hasAddedorRemovedFiles) {
|
|
169753
169766
|
if (!this.autoImportProviderHost)
|
|
169754
169767
|
this.autoImportProviderHost = void 0;
|
|
169755
|
-
(
|
|
169768
|
+
(_c = this.autoImportProviderHost) == null ? void 0 : _c.markAsDirty();
|
|
169756
169769
|
}
|
|
169757
169770
|
if (isFirstProgramLoad) {
|
|
169758
169771
|
this.getPackageJsonAutoImportProvider();
|
|
169759
169772
|
}
|
|
169760
|
-
perfLogger.logStopUpdateGraph();
|
|
169761
|
-
(
|
|
169773
|
+
(_d = perfLogger) == null ? void 0 : _d.logStopUpdateGraph();
|
|
169774
|
+
(_e = tracing) == null ? void 0 : _e.pop();
|
|
169762
169775
|
return !hasNewProgram;
|
|
169763
169776
|
}
|
|
169764
169777
|
/** @internal */
|
|
@@ -175936,8 +175949,9 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
175936
175949
|
this.writeMessage(msg);
|
|
175937
175950
|
}
|
|
175938
175951
|
writeMessage(msg) {
|
|
175952
|
+
var _a2;
|
|
175939
175953
|
const msgText = formatMessage2(msg, this.logger, this.byteLength, this.host.newLine);
|
|
175940
|
-
perfLogger.logEvent(`Response message size: ${msgText.length}`);
|
|
175954
|
+
(_a2 = perfLogger) == null ? void 0 : _a2.logEvent(`Response message size: ${msgText.length}`);
|
|
175941
175955
|
this.host.write(msgText);
|
|
175942
175956
|
}
|
|
175943
175957
|
event(body, eventName) {
|
|
@@ -177705,7 +177719,7 @@ ${e.message}`;
|
|
|
177705
177719
|
}
|
|
177706
177720
|
}
|
|
177707
177721
|
onMessage(message) {
|
|
177708
|
-
var _a2, _b, _c, _d, _e, _f, _g;
|
|
177722
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
177709
177723
|
this.gcTimer.scheduleCollect();
|
|
177710
177724
|
this.performanceData = void 0;
|
|
177711
177725
|
let start;
|
|
@@ -177721,8 +177735,8 @@ ${e.message}`;
|
|
|
177721
177735
|
request = this.parseMessage(message);
|
|
177722
177736
|
relevantFile = request.arguments && request.arguments.file ? request.arguments : void 0;
|
|
177723
177737
|
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.Session, "request", { seq: request.seq, command: request.command });
|
|
177724
|
-
perfLogger.logStartCommand("" + request.command, this.toStringMessage(message).substring(0, 100));
|
|
177725
|
-
(
|
|
177738
|
+
(_b = perfLogger) == null ? void 0 : _b.logStartCommand("" + request.command, this.toStringMessage(message).substring(0, 100));
|
|
177739
|
+
(_c = tracing) == null ? void 0 : _c.push(
|
|
177726
177740
|
tracing.Phase.Session,
|
|
177727
177741
|
"executeCommand",
|
|
177728
177742
|
{ seq: request.seq, command: request.command },
|
|
@@ -177730,7 +177744,7 @@ ${e.message}`;
|
|
|
177730
177744
|
true
|
|
177731
177745
|
);
|
|
177732
177746
|
const { response, responseRequired } = this.executeCommand(request);
|
|
177733
|
-
(
|
|
177747
|
+
(_d = tracing) == null ? void 0 : _d.pop();
|
|
177734
177748
|
if (this.logger.hasLevel(2 /* requestTime */)) {
|
|
177735
177749
|
const elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4);
|
|
177736
177750
|
if (responseRequired) {
|
|
@@ -177739,8 +177753,8 @@ ${e.message}`;
|
|
|
177739
177753
|
this.logger.perftrc(`${request.seq}::${request.command}: async elapsed time (in milliseconds) ${elapsedTime}`);
|
|
177740
177754
|
}
|
|
177741
177755
|
}
|
|
177742
|
-
perfLogger.logStopCommand("" + request.command, "Success");
|
|
177743
|
-
(
|
|
177756
|
+
(_e = perfLogger) == null ? void 0 : _e.logStopCommand("" + request.command, "Success");
|
|
177757
|
+
(_f = tracing) == null ? void 0 : _f.instant(tracing.Phase.Session, "response", { seq: request.seq, command: request.command, success: !!response });
|
|
177744
177758
|
if (response) {
|
|
177745
177759
|
this.doOutput(
|
|
177746
177760
|
response,
|
|
@@ -177761,10 +177775,10 @@ ${e.message}`;
|
|
|
177761
177775
|
);
|
|
177762
177776
|
}
|
|
177763
177777
|
} catch (err) {
|
|
177764
|
-
(
|
|
177778
|
+
(_g = tracing) == null ? void 0 : _g.popAll();
|
|
177765
177779
|
if (err instanceof OperationCanceledException) {
|
|
177766
|
-
perfLogger.logStopCommand("" + (request && request.command), "Canceled: " + err);
|
|
177767
|
-
(
|
|
177780
|
+
(_h = perfLogger) == null ? void 0 : _h.logStopCommand("" + (request && request.command), "Canceled: " + err);
|
|
177781
|
+
(_i = tracing) == null ? void 0 : _i.instant(tracing.Phase.Session, "commandCanceled", { seq: request == null ? void 0 : request.seq, command: request == null ? void 0 : request.command });
|
|
177768
177782
|
this.doOutput(
|
|
177769
177783
|
{ canceled: true },
|
|
177770
177784
|
request.command,
|
|
@@ -177775,8 +177789,8 @@ ${e.message}`;
|
|
|
177775
177789
|
return;
|
|
177776
177790
|
}
|
|
177777
177791
|
this.logErrorWorker(err, this.toStringMessage(message), relevantFile);
|
|
177778
|
-
perfLogger.logStopCommand("" + (request && request.command), "Error: " + err);
|
|
177779
|
-
(
|
|
177792
|
+
(_j = perfLogger) == null ? void 0 : _j.logStopCommand("" + (request && request.command), "Error: " + err);
|
|
177793
|
+
(_k = tracing) == null ? void 0 : _k.instant(tracing.Phase.Session, "commandError", { seq: request == null ? void 0 : request.seq, command: request == null ? void 0 : request.command, message: err.message });
|
|
177780
177794
|
this.doOutput(
|
|
177781
177795
|
/*info*/
|
|
177782
177796
|
void 0,
|