Skip to content

Commit

Permalink
Bump version to 5.0.3 and LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
typescript-bot committed Mar 30, 2023
1 parent 111df34 commit 0e198c2
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 75 deletions.
2 changes: 1 addition & 1 deletion lib/lib.decorators.legacy.d.ts
Expand Up @@ -19,4 +19,4 @@ and limitations under the License.
declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
declare type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
47 changes: 30 additions & 17 deletions lib/tsc.js
Expand Up @@ -23,7 +23,7 @@ var __export = (target, all) => {

// src/compiler/corePublic.ts
var versionMajorMinor = "5.0";
var version = "5.0.2";
var version = "5.0.3";

// src/compiler/core.ts
var emptyArray = [];
Expand Down Expand Up @@ -37424,7 +37424,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
}
function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
return nodeModuleNameResolverWorker(
8 /* Exports */,
30 /* NodeNextDefault */,
moduleName,
getDirectoryPath(containingFile),
{ moduleResolution: 99 /* NodeNext */ },
Expand Down Expand Up @@ -53129,9 +53129,10 @@ function createTypeChecker(host) {
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
const typeParameter = getTypeParameterFromMappedType(type);
const constraintType = getConstraintTypeFromMappedType(type);
const nameType = getNameTypeFromMappedType(type.target || type);
const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
const templateType = getTemplateTypeFromMappedType(type.target || type);
const mappedType = type.target || type;
const nameType = getNameTypeFromMappedType(mappedType);
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
const templateType = getTemplateTypeFromMappedType(mappedType);
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
const templateModifiers = getMappedTypeModifiers(type);
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
Expand Down Expand Up @@ -53168,7 +53169,7 @@ function createTypeChecker(host) {
prop.links.keyType = keyType;
if (modifiersProp) {
prop.links.syntheticOrigin = modifiersProp;
prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
}
members.set(propName, prop);
}
Expand Down Expand Up @@ -53274,6 +53275,10 @@ function createTypeChecker(host) {
}
return false;
}
function isFilteringMappedType(type) {
const nameType = getNameTypeFromMappedType(type);
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
}
function resolveStructuredTypeMembers(type) {
if (!type.members) {
if (type.flags & 524288 /* Object */) {
Expand Down Expand Up @@ -55778,6 +55783,12 @@ function createTypeChecker(host) {
i--;
const source = types[i];
if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) {
if (source.flags & 262144 /* TypeParameter */ && getBaseConstraintOrType(source).flags & 1048576 /* Union */) {
if (isTypeRelatedTo(source, getUnionType(map(types, (t) => t === source ? neverType : t)), strictSubtypeRelation)) {
orderedRemoveItemAt(types, i);
}
continue;
}
const keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */) ? find(getPropertiesOfType(source), (p) => isUnitType(getTypeOfSymbol(p))) : void 0;
const keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty));
for (const target of types) {
Expand Down Expand Up @@ -56815,8 +56826,7 @@ function createTypeChecker(host) {
}
}
if (isGenericMappedType(objectType)) {
const nameType = getNameTypeFromMappedType(objectType);
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
}
}
Expand Down Expand Up @@ -61315,7 +61325,7 @@ function createTypeChecker(host) {
const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType);
let result2 = -1 /* True */;
for (const targetInfo of indexInfos) {
const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
if (!related) {
return 0 /* False */;
}
Expand Down Expand Up @@ -78983,14 +78993,14 @@ function createTypeChecker(host) {
markAliasReferenced(sym, id);
if (getAllSymbolFlags(sym) & 111551 /* Value */) {
checkExpressionCached(id);
if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
error(
id,
node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,
idText(id)
);
}
} else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) {
} else if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax) {
error(
id,
node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type,
Expand Down Expand Up @@ -91030,10 +91040,14 @@ function transformESDecorators(context) {
visitor
);
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0;
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0));
addRange(statements, initializerStatements);
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper));
if (superStatementIndex >= 0) {
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
addRange(statements, initializerStatements);
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
} else {
addRange(statements, initializerStatements);
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
}
body = factory2.createBlock(
statements,
/*multiLine*/
Expand Down Expand Up @@ -119815,7 +119829,6 @@ function createWatchProgram(host) {
);
}
function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) {
Debug.assert(configFileName);
updateSharedExtendedConfigFileWatcher(
forProjectPath,
options,
Expand All @@ -119831,7 +119844,7 @@ function createWatchProgram(host) {
if (!(projects == null ? void 0 : projects.size))
return;
projects.forEach((projectPath) => {
if (toPath3(configFileName) === projectPath) {
if (configFileName && toPath3(configFileName) === projectPath) {
reloadLevel = 2 /* Full */;
} else {
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath);
Expand Down
49 changes: 31 additions & 18 deletions lib/tsserver.js
Expand Up @@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(server_exports);

// src/compiler/corePublic.ts
var versionMajorMinor = "5.0";
var version = "5.0.2";
var version = "5.0.3";
var Comparison = /* @__PURE__ */ ((Comparison3) => {
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
Expand Down Expand Up @@ -41868,7 +41868,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
}
function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
return nodeModuleNameResolverWorker(
8 /* Exports */,
30 /* NodeNextDefault */,
moduleName,
getDirectoryPath(containingFile),
{ moduleResolution: 99 /* NodeNext */ },
Expand Down Expand Up @@ -57728,9 +57728,10 @@ function createTypeChecker(host) {
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
const typeParameter = getTypeParameterFromMappedType(type);
const constraintType = getConstraintTypeFromMappedType(type);
const nameType = getNameTypeFromMappedType(type.target || type);
const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
const templateType = getTemplateTypeFromMappedType(type.target || type);
const mappedType = type.target || type;
const nameType = getNameTypeFromMappedType(mappedType);
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
const templateType = getTemplateTypeFromMappedType(mappedType);
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
const templateModifiers = getMappedTypeModifiers(type);
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
Expand Down Expand Up @@ -57767,7 +57768,7 @@ function createTypeChecker(host) {
prop.links.keyType = keyType;
if (modifiersProp) {
prop.links.syntheticOrigin = modifiersProp;
prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
}
members.set(propName, prop);
}
Expand Down Expand Up @@ -57873,6 +57874,10 @@ function createTypeChecker(host) {
}
return false;
}
function isFilteringMappedType(type) {
const nameType = getNameTypeFromMappedType(type);
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
}
function resolveStructuredTypeMembers(type) {
if (!type.members) {
if (type.flags & 524288 /* Object */) {
Expand Down Expand Up @@ -60377,6 +60382,12 @@ function createTypeChecker(host) {
i--;
const source = types[i];
if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) {
if (source.flags & 262144 /* TypeParameter */ && getBaseConstraintOrType(source).flags & 1048576 /* Union */) {
if (isTypeRelatedTo(source, getUnionType(map(types, (t) => t === source ? neverType : t)), strictSubtypeRelation)) {
orderedRemoveItemAt(types, i);
}
continue;
}
const keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */) ? find(getPropertiesOfType(source), (p) => isUnitType(getTypeOfSymbol(p))) : void 0;
const keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty));
for (const target of types) {
Expand Down Expand Up @@ -61414,8 +61425,7 @@ function createTypeChecker(host) {
}
}
if (isGenericMappedType(objectType)) {
const nameType = getNameTypeFromMappedType(objectType);
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
}
}
Expand Down Expand Up @@ -65914,7 +65924,7 @@ function createTypeChecker(host) {
const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType);
let result2 = -1 /* True */;
for (const targetInfo of indexInfos) {
const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
if (!related) {
return 0 /* False */;
}
Expand Down Expand Up @@ -83582,14 +83592,14 @@ function createTypeChecker(host) {
markAliasReferenced(sym, id);
if (getAllSymbolFlags(sym) & 111551 /* Value */) {
checkExpressionCached(id);
if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
error(
id,
node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,
idText(id)
);
}
} else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) {
} else if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax) {
error(
id,
node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type,
Expand Down Expand Up @@ -95800,10 +95810,14 @@ function transformESDecorators(context) {
visitor
);
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0;
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0));
addRange(statements, initializerStatements);
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper));
if (superStatementIndex >= 0) {
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
addRange(statements, initializerStatements);
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
} else {
addRange(statements, initializerStatements);
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
}
body = factory2.createBlock(
statements,
/*multiLine*/
Expand Down Expand Up @@ -124707,7 +124721,6 @@ function createWatchProgram(host) {
);
}
function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) {
Debug.assert(configFileName);
updateSharedExtendedConfigFileWatcher(
forProjectPath,
options,
Expand All @@ -124723,7 +124736,7 @@ function createWatchProgram(host) {
if (!(projects == null ? void 0 : projects.size))
return;
projects.forEach((projectPath) => {
if (toPath3(configFileName) === projectPath) {
if (configFileName && toPath3(configFileName) === projectPath) {
reloadLevel = 2 /* Full */;
} else {
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath);
Expand Down Expand Up @@ -152027,7 +152040,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value));
return { kind: 2 /* Types */, types: literals, isNewIdentifier: false };
default:
return fromContextualType();
return fromContextualType() || fromContextualType(0 /* None */);
}
function fromContextualType(contextFlags = 4 /* Completions */) {
const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
Expand Down

0 comments on commit 0e198c2

Please sign in to comment.