typescript 4.9.0-dev.20220831 → 4.9.0-dev.20220903

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.
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220831");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220903");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -44871,7 +44871,7 @@ var ts;
44871
44871
  var _a, _b;
44872
44872
  if (path === undefined)
44873
44873
  return path;
44874
- return ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames })(ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)));
44874
+ return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
44875
44875
  }
44876
44876
  function combineDirectoryPath(root, dir) {
44877
44877
  return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
@@ -44891,7 +44891,7 @@ var ts;
44891
44891
  if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
44892
44892
  && (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
44893
44893
  && finalPath.indexOf("/node_modules/") === -1
44894
- && (state.compilerOptions.configFile ? ts.startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true)) {
44894
+ && (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
44895
44895
  // So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
44896
44896
  // Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
44897
44897
  // `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
@@ -44947,7 +44947,7 @@ var ts;
44947
44947
  var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
44948
44948
  for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
44949
44949
  var candidateDir = candidateDirectories_1[_e];
44950
- if (ts.startsWith(finalPath, candidateDir)) {
44950
+ if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
44951
44951
  // The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
44952
44952
  var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
44953
44953
  var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
@@ -62517,7 +62517,7 @@ var ts;
62517
62517
  return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
62518
62518
  }
62519
62519
  if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
62520
- return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62520
+ return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62521
62521
  }
62522
62522
  if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
62523
62523
  includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
@@ -63207,7 +63207,7 @@ var ts;
63207
63207
  // (T | U)[K] -> T[K] | U[K] (reading)
63208
63208
  // (T | U)[K] -> T[K] & U[K] (writing)
63209
63209
  // (T & U)[K] -> T[K] & U[K]
63210
- if (objectType.flags & 3145728 /* TypeFlags.UnionOrIntersection */) {
63210
+ if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
63211
63211
  var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
63212
63212
  return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
63213
63213
  }
@@ -65611,7 +65611,7 @@ var ts;
65611
65611
  if (reduced !== type) {
65612
65612
  return reduced;
65613
65613
  }
65614
- if (type.flags & 2097152 /* TypeFlags.Intersection */) {
65614
+ if (type.flags & 2097152 /* TypeFlags.Intersection */ && ts.some(type.types, isEmptyAnonymousObjectType)) {
65615
65615
  var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
65616
65616
  if (normalizedTypes !== type.types) {
65617
65617
  return getIntersectionType(normalizedTypes);
@@ -71909,7 +71909,7 @@ var ts;
71909
71909
  var narrowedPropType = narrowType(propType);
71910
71910
  return filterType(type, function (t) {
71911
71911
  var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
71912
- return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && isTypeComparableTo(narrowedPropType, discriminantType);
71912
+ return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
71913
71913
  });
71914
71914
  }
71915
71915
  function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
@@ -71958,7 +71958,7 @@ var ts;
71958
71958
  }
71959
71959
  function narrowByInKeyword(type, name, assumeTrue) {
71960
71960
  if (type.flags & 1048576 /* TypeFlags.Union */
71961
- || type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type
71961
+ || type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
71962
71962
  || ts.isThisTypeParameter(type)
71963
71963
  || type.flags & 2097152 /* TypeFlags.Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
71964
71964
  return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
@@ -72091,14 +72091,18 @@ var ts;
72091
72091
  assumeTrue = !assumeTrue;
72092
72092
  }
72093
72093
  var valueType = getTypeOfExpression(value);
72094
- if ((type.flags & 2 /* TypeFlags.Unknown */) && assumeTrue && (operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */)) {
72094
+ if (((type.flags & 2 /* TypeFlags.Unknown */) || isEmptyAnonymousObjectType(type) && !(valueType.flags & 98304 /* TypeFlags.Nullable */)) &&
72095
+ assumeTrue &&
72096
+ (operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */)) {
72095
72097
  if (valueType.flags & (131068 /* TypeFlags.Primitive */ | 67108864 /* TypeFlags.NonPrimitive */)) {
72096
72098
  return valueType;
72097
72099
  }
72098
72100
  if (valueType.flags & 524288 /* TypeFlags.Object */) {
72099
72101
  return nonPrimitiveType;
72100
72102
  }
72101
- return type;
72103
+ if (type.flags & 2 /* TypeFlags.Unknown */) {
72104
+ return type;
72105
+ }
72102
72106
  }
72103
72107
  if (valueType.flags & 98304 /* TypeFlags.Nullable */) {
72104
72108
  if (!strictNullChecks) {
@@ -72130,11 +72134,18 @@ var ts;
72130
72134
  }
72131
72135
  var target = getReferenceCandidate(typeOfExpr.expression);
72132
72136
  if (!isMatchingReference(reference, target)) {
72137
+ var propertyAccess = getDiscriminantPropertyAccess(typeOfExpr.expression, type);
72138
+ if (propertyAccess) {
72139
+ return narrowTypeByDiscriminant(type, propertyAccess, function (t) { return narrowTypeByLiteralExpression(t, literal, assumeTrue); });
72140
+ }
72133
72141
  if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
72134
72142
  return getAdjustedTypeWithFacts(type, 2097152 /* TypeFacts.NEUndefinedOrNull */);
72135
72143
  }
72136
72144
  return type;
72137
72145
  }
72146
+ return narrowTypeByLiteralExpression(type, literal, assumeTrue);
72147
+ }
72148
+ function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
72138
72149
  return assumeTrue ?
72139
72150
  narrowTypeByTypeName(type, literal.text) :
72140
72151
  getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeFacts.TypeofNEHostObject */);
@@ -74907,6 +74918,7 @@ var ts;
74907
74918
  */
74908
74919
  function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
74909
74920
  var attributes = openingLikeElement.attributes;
74921
+ var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
74910
74922
  var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
74911
74923
  var attributesTable = ts.createSymbolTable();
74912
74924
  var spread = emptyJsxObjectType;
@@ -74934,6 +74946,12 @@ var ts;
74934
74946
  if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
74935
74947
  explicitlySpecifyChildrenAttribute = true;
74936
74948
  }
74949
+ if (attributesType) {
74950
+ var prop = getPropertyOfType(attributesType, member.escapedName);
74951
+ if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
74952
+ addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
74953
+ }
74954
+ }
74937
74955
  }
74938
74956
  else {
74939
74957
  ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
@@ -120597,10 +120615,12 @@ var ts;
120597
120615
  if (options.preserveConstEnums === false) {
120598
120616
  createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
120599
120617
  }
120600
- var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !ts.isSourceFileJS(f) && !f.isDeclarationFile && f.scriptKind !== 6 /* ScriptKind.JSON */; });
120601
- if (firstNonExternalModuleSourceFile) {
120602
- var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);
120603
- programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(firstNonExternalModuleSourceFile.fileName)));
120618
+ for (var _a = 0, files_5 = files; _a < files_5.length; _a++) {
120619
+ var file = files_5[_a];
120620
+ if (!ts.isExternalModule(file) && !ts.isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6 /* ScriptKind.JSON */) {
120621
+ var span = ts.getErrorSpanForNode(file, file);
120622
+ programDiagnostics.add(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(file.fileName)));
120623
+ }
120604
120624
  }
120605
120625
  }
120606
120626
  else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ScriptTarget.ES2015 */ && options.module === ts.ModuleKind.None) {
@@ -127381,9 +127401,7 @@ var ts;
127381
127401
  }
127382
127402
  }
127383
127403
  }
127384
- var seenRefs = buildInfoPath ? new ts.Set() : undefined;
127385
127404
  var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
127386
- seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
127387
127405
  /** Inputs are up-to-date, just need either timestamp update or bundle prepend manipulation to make it look up-to-date */
127388
127406
  var pseudoUpToDate = false;
127389
127407
  var usesPrepend = false;
@@ -127398,7 +127416,7 @@ var ts;
127398
127416
  continue;
127399
127417
  }
127400
127418
  // Check if tsbuildinfo path is shared, then we need to rebuild
127401
- if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath)) {
127419
+ if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
127402
127420
  return {
127403
127421
  type: ts.UpToDateStatusType.OutOfDateWithUpstream,
127404
127422
  outOfDateOutputFileName: buildInfoPath,
@@ -127456,25 +127474,9 @@ var ts;
127456
127474
  oldestOutputFileName: oldestOutputFileName
127457
127475
  };
127458
127476
  }
127459
- function hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath) {
127460
- if (seenRefs.has(resolvedRefPath))
127461
- return false;
127462
- seenRefs.add(resolvedRefPath);
127477
+ function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
127463
127478
  var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
127464
- if (refBuildInfo.path === buildInfoCacheEntry.path)
127465
- return true;
127466
- if (resolvedConfig.projectReferences) {
127467
- // Check references
127468
- for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
127469
- var ref = _a[_i];
127470
- var resolvedRef = ts.resolveProjectReferencePath(ref);
127471
- var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
127472
- var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
127473
- if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
127474
- return true;
127475
- }
127476
- }
127477
- return false;
127479
+ return refBuildInfo.path === buildInfoCacheEntry.path;
127478
127480
  }
127479
127481
  function getUpToDateStatus(state, project, resolvedPath) {
127480
127482
  if (project === undefined) {
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220831");
92
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220903");
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -44861,7 +44861,7 @@ var ts;
44861
44861
  var _a, _b;
44862
44862
  if (path === undefined)
44863
44863
  return path;
44864
- return ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames })(ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)));
44864
+ return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
44865
44865
  }
44866
44866
  function combineDirectoryPath(root, dir) {
44867
44867
  return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
@@ -44881,7 +44881,7 @@ var ts;
44881
44881
  if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
44882
44882
  && (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
44883
44883
  && finalPath.indexOf("/node_modules/") === -1
44884
- && (state.compilerOptions.configFile ? ts.startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true)) {
44884
+ && (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
44885
44885
  // So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
44886
44886
  // Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
44887
44887
  // `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
@@ -44937,7 +44937,7 @@ var ts;
44937
44937
  var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
44938
44938
  for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
44939
44939
  var candidateDir = candidateDirectories_1[_e];
44940
- if (ts.startsWith(finalPath, candidateDir)) {
44940
+ if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
44941
44941
  // The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
44942
44942
  var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
44943
44943
  var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
@@ -62507,7 +62507,7 @@ var ts;
62507
62507
  return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
62508
62508
  }
62509
62509
  if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
62510
- return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62510
+ return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62511
62511
  }
62512
62512
  if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
62513
62513
  includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
@@ -63197,7 +63197,7 @@ var ts;
63197
63197
  // (T | U)[K] -> T[K] | U[K] (reading)
63198
63198
  // (T | U)[K] -> T[K] & U[K] (writing)
63199
63199
  // (T & U)[K] -> T[K] & U[K]
63200
- if (objectType.flags & 3145728 /* TypeFlags.UnionOrIntersection */) {
63200
+ if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
63201
63201
  var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
63202
63202
  return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
63203
63203
  }
@@ -65601,7 +65601,7 @@ var ts;
65601
65601
  if (reduced !== type) {
65602
65602
  return reduced;
65603
65603
  }
65604
- if (type.flags & 2097152 /* TypeFlags.Intersection */) {
65604
+ if (type.flags & 2097152 /* TypeFlags.Intersection */ && ts.some(type.types, isEmptyAnonymousObjectType)) {
65605
65605
  var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
65606
65606
  if (normalizedTypes !== type.types) {
65607
65607
  return getIntersectionType(normalizedTypes);
@@ -71899,7 +71899,7 @@ var ts;
71899
71899
  var narrowedPropType = narrowType(propType);
71900
71900
  return filterType(type, function (t) {
71901
71901
  var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
71902
- return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && isTypeComparableTo(narrowedPropType, discriminantType);
71902
+ return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
71903
71903
  });
71904
71904
  }
71905
71905
  function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
@@ -71948,7 +71948,7 @@ var ts;
71948
71948
  }
71949
71949
  function narrowByInKeyword(type, name, assumeTrue) {
71950
71950
  if (type.flags & 1048576 /* TypeFlags.Union */
71951
- || type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type
71951
+ || type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
71952
71952
  || ts.isThisTypeParameter(type)
71953
71953
  || type.flags & 2097152 /* TypeFlags.Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
71954
71954
  return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
@@ -72081,14 +72081,18 @@ var ts;
72081
72081
  assumeTrue = !assumeTrue;
72082
72082
  }
72083
72083
  var valueType = getTypeOfExpression(value);
72084
- if ((type.flags & 2 /* TypeFlags.Unknown */) && assumeTrue && (operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */)) {
72084
+ if (((type.flags & 2 /* TypeFlags.Unknown */) || isEmptyAnonymousObjectType(type) && !(valueType.flags & 98304 /* TypeFlags.Nullable */)) &&
72085
+ assumeTrue &&
72086
+ (operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */)) {
72085
72087
  if (valueType.flags & (131068 /* TypeFlags.Primitive */ | 67108864 /* TypeFlags.NonPrimitive */)) {
72086
72088
  return valueType;
72087
72089
  }
72088
72090
  if (valueType.flags & 524288 /* TypeFlags.Object */) {
72089
72091
  return nonPrimitiveType;
72090
72092
  }
72091
- return type;
72093
+ if (type.flags & 2 /* TypeFlags.Unknown */) {
72094
+ return type;
72095
+ }
72092
72096
  }
72093
72097
  if (valueType.flags & 98304 /* TypeFlags.Nullable */) {
72094
72098
  if (!strictNullChecks) {
@@ -72120,11 +72124,18 @@ var ts;
72120
72124
  }
72121
72125
  var target = getReferenceCandidate(typeOfExpr.expression);
72122
72126
  if (!isMatchingReference(reference, target)) {
72127
+ var propertyAccess = getDiscriminantPropertyAccess(typeOfExpr.expression, type);
72128
+ if (propertyAccess) {
72129
+ return narrowTypeByDiscriminant(type, propertyAccess, function (t) { return narrowTypeByLiteralExpression(t, literal, assumeTrue); });
72130
+ }
72123
72131
  if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
72124
72132
  return getAdjustedTypeWithFacts(type, 2097152 /* TypeFacts.NEUndefinedOrNull */);
72125
72133
  }
72126
72134
  return type;
72127
72135
  }
72136
+ return narrowTypeByLiteralExpression(type, literal, assumeTrue);
72137
+ }
72138
+ function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
72128
72139
  return assumeTrue ?
72129
72140
  narrowTypeByTypeName(type, literal.text) :
72130
72141
  getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeFacts.TypeofNEHostObject */);
@@ -74897,6 +74908,7 @@ var ts;
74897
74908
  */
74898
74909
  function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
74899
74910
  var attributes = openingLikeElement.attributes;
74911
+ var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
74900
74912
  var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
74901
74913
  var attributesTable = ts.createSymbolTable();
74902
74914
  var spread = emptyJsxObjectType;
@@ -74924,6 +74936,12 @@ var ts;
74924
74936
  if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
74925
74937
  explicitlySpecifyChildrenAttribute = true;
74926
74938
  }
74939
+ if (attributesType) {
74940
+ var prop = getPropertyOfType(attributesType, member.escapedName);
74941
+ if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
74942
+ addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
74943
+ }
74944
+ }
74927
74945
  }
74928
74946
  else {
74929
74947
  ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
@@ -120587,10 +120605,12 @@ var ts;
120587
120605
  if (options.preserveConstEnums === false) {
120588
120606
  createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
120589
120607
  }
120590
- var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !ts.isSourceFileJS(f) && !f.isDeclarationFile && f.scriptKind !== 6 /* ScriptKind.JSON */; });
120591
- if (firstNonExternalModuleSourceFile) {
120592
- var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);
120593
- programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(firstNonExternalModuleSourceFile.fileName)));
120608
+ for (var _a = 0, files_5 = files; _a < files_5.length; _a++) {
120609
+ var file = files_5[_a];
120610
+ if (!ts.isExternalModule(file) && !ts.isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6 /* ScriptKind.JSON */) {
120611
+ var span = ts.getErrorSpanForNode(file, file);
120612
+ programDiagnostics.add(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(file.fileName)));
120613
+ }
120594
120614
  }
120595
120615
  }
120596
120616
  else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ScriptTarget.ES2015 */ && options.module === ts.ModuleKind.None) {
@@ -127371,9 +127391,7 @@ var ts;
127371
127391
  }
127372
127392
  }
127373
127393
  }
127374
- var seenRefs = buildInfoPath ? new ts.Set() : undefined;
127375
127394
  var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
127376
- seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
127377
127395
  /** Inputs are up-to-date, just need either timestamp update or bundle prepend manipulation to make it look up-to-date */
127378
127396
  var pseudoUpToDate = false;
127379
127397
  var usesPrepend = false;
@@ -127388,7 +127406,7 @@ var ts;
127388
127406
  continue;
127389
127407
  }
127390
127408
  // Check if tsbuildinfo path is shared, then we need to rebuild
127391
- if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath)) {
127409
+ if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
127392
127410
  return {
127393
127411
  type: ts.UpToDateStatusType.OutOfDateWithUpstream,
127394
127412
  outOfDateOutputFileName: buildInfoPath,
@@ -127446,25 +127464,9 @@ var ts;
127446
127464
  oldestOutputFileName: oldestOutputFileName
127447
127465
  };
127448
127466
  }
127449
- function hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig, resolvedRefPath) {
127450
- if (seenRefs.has(resolvedRefPath))
127451
- return false;
127452
- seenRefs.add(resolvedRefPath);
127467
+ function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
127453
127468
  var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
127454
- if (refBuildInfo.path === buildInfoCacheEntry.path)
127455
- return true;
127456
- if (resolvedConfig.projectReferences) {
127457
- // Check references
127458
- for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
127459
- var ref = _a[_i];
127460
- var resolvedRef = ts.resolveProjectReferencePath(ref);
127461
- var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
127462
- var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
127463
- if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
127464
- return true;
127465
- }
127466
- }
127467
- return false;
127469
+ return refBuildInfo.path === buildInfoCacheEntry.path;
127468
127470
  }
127469
127471
  function getUpToDateStatus(state, project, resolvedPath) {
127470
127472
  if (project === undefined) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.9.0-dev.20220831",
5
+ "version": "4.9.0-dev.20220903",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [