@typescript-deploys/pr-build 4.9.0-pr-50976-13 → 4.9.0-pr-51026-8

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.
@@ -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-insiders.20220929");
92
+ ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20221003");
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -11358,7 +11358,7 @@ var ts;
11358
11358
  return -1;
11359
11359
  }
11360
11360
  function peekExtendedUnicodeEscape() {
11361
- if (languageVersion >= 2 /* ScriptTarget.ES2015 */ && codePointAt(text, pos + 1) === 117 /* CharacterCodes.u */ && codePointAt(text, pos + 2) === 123 /* CharacterCodes.openBrace */) {
11361
+ if (codePointAt(text, pos + 1) === 117 /* CharacterCodes.u */ && codePointAt(text, pos + 2) === 123 /* CharacterCodes.openBrace */) {
11362
11362
  var start_2 = pos;
11363
11363
  pos += 3;
11364
11364
  var escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);
@@ -23139,7 +23139,7 @@ var ts;
23139
23139
  return node;
23140
23140
  }
23141
23141
  // @api
23142
- function createIdentifier(text, typeArguments, originalKeywordKind) {
23142
+ function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
23143
23143
  var node = createBaseIdentifier(text, originalKeywordKind);
23144
23144
  if (typeArguments) {
23145
23145
  // NOTE: we do not use `setChildren` here because typeArguments in an identifier do not contribute to transformations
@@ -23148,6 +23148,10 @@ var ts;
23148
23148
  if (node.originalKeywordKind === 133 /* SyntaxKind.AwaitKeyword */) {
23149
23149
  node.transformFlags |= 67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */;
23150
23150
  }
23151
+ if (hasExtendedUnicodeEscape) {
23152
+ node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
23153
+ node.transformFlags |= 1024 /* TransformFlags.ContainsES2015 */;
23154
+ }
23151
23155
  return node;
23152
23156
  }
23153
23157
  // @api
@@ -33082,8 +33086,9 @@ var ts;
33082
33086
  // Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
33083
33087
  var originalKeywordKind = token();
33084
33088
  var text = internIdentifier(scanner.getTokenValue());
33089
+ var hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
33085
33090
  nextTokenWithoutCheck();
33086
- return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind), pos);
33091
+ return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind, hasExtendedUnicodeEscape), pos);
33087
33092
  }
33088
33093
  if (token() === 80 /* SyntaxKind.PrivateIdentifier */) {
33089
33094
  parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
@@ -49478,6 +49483,12 @@ var ts;
49478
49483
  getOptionalType: function () { return optionalType; },
49479
49484
  getPromiseType: function () { return getGlobalPromiseType(/*reportErrors*/ false); },
49480
49485
  getPromiseLikeType: function () { return getGlobalPromiseLikeType(/*reportErrors*/ false); },
49486
+ getAsyncIterableType: function () {
49487
+ var type = getGlobalAsyncIterableType(/*reportErrors*/ false);
49488
+ if (type === emptyGenericType)
49489
+ return undefined;
49490
+ return type;
49491
+ },
49481
49492
  isSymbolAccessible: isSymbolAccessible,
49482
49493
  isArrayType: isArrayType,
49483
49494
  isTupleType: isTupleType,
@@ -50315,9 +50326,9 @@ var ts;
50315
50326
  return symbol;
50316
50327
  }
50317
50328
  if (symbol.flags & 2097152 /* SymbolFlags.Alias */) {
50318
- var target = resolveAlias(symbol);
50319
- // Unknown symbol means an error occurred in alias resolution, treat it as positive answer to avoid cascading errors
50320
- if (target === unknownSymbol || target.flags & meaning) {
50329
+ var targetFlags = getAllSymbolFlags(symbol);
50330
+ // `targetFlags` will be `SymbolFlags.All` if an error occurred in alias resolution; this avoids cascading errors
50331
+ if (targetFlags & meaning) {
50321
50332
  return symbol;
50322
50333
  }
50323
50334
  }
@@ -50950,8 +50961,8 @@ var ts;
50950
50961
  !checkAndReportErrorForExtendingInterface(errorLocation) &&
50951
50962
  !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) &&
50952
50963
  !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) &&
50964
+ !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) &&
50953
50965
  !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) &&
50954
- !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
50955
50966
  !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
50956
50967
  var suggestion = void 0;
50957
50968
  var suggestedLib = void 0;
@@ -51038,7 +51049,7 @@ var ts;
51038
51049
  }
51039
51050
  }
51040
51051
  if (result && errorLocation && meaning & 111551 /* SymbolFlags.Value */ && result.flags & 2097152 /* SymbolFlags.Alias */ && !(result.flags & 111551 /* SymbolFlags.Value */) && !ts.isValidTypeOnlyAliasUseSite(errorLocation)) {
51041
- var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result);
51052
+ var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* SymbolFlags.Value */);
51042
51053
  if (typeOnlyDeclaration) {
51043
51054
  var message = typeOnlyDeclaration.kind === 278 /* SyntaxKind.ExportSpecifier */
51044
51055
  ? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
@@ -51201,7 +51212,7 @@ var ts;
51201
51212
  return false;
51202
51213
  }
51203
51214
  function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
51204
- if (meaning & (111551 /* SymbolFlags.Value */ & ~1024 /* SymbolFlags.NamespaceModule */)) {
51215
+ if (meaning & 111551 /* SymbolFlags.Value */) {
51205
51216
  if (isPrimitiveTypeName(name)) {
51206
51217
  if (isExtendedByInterface(errorLocation)) {
51207
51218
  error(errorLocation, ts.Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, ts.unescapeLeadingUnderscores(name));
@@ -51212,7 +51223,8 @@ var ts;
51212
51223
  return true;
51213
51224
  }
51214
51225
  var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* SymbolFlags.Type */ & ~111551 /* SymbolFlags.Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
51215
- if (symbol && !(symbol.flags & 1024 /* SymbolFlags.NamespaceModule */)) {
51226
+ var allFlags = symbol && getAllSymbolFlags(symbol);
51227
+ if (symbol && allFlags !== undefined && !(allFlags & 111551 /* SymbolFlags.Value */)) {
51216
51228
  var rawName = ts.unescapeLeadingUnderscores(name);
51217
51229
  if (isES2015OrLaterConstructorName(name)) {
51218
51230
  error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName);
@@ -51260,16 +51272,16 @@ var ts;
51260
51272
  }
51261
51273
  return false;
51262
51274
  }
51263
- function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) {
51264
- if (meaning & (111551 /* SymbolFlags.Value */ & ~1024 /* SymbolFlags.NamespaceModule */ & ~788968 /* SymbolFlags.Type */)) {
51265
- var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* SymbolFlags.NamespaceModule */ & ~111551 /* SymbolFlags.Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
51275
+ function checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) {
51276
+ if (meaning & (111551 /* SymbolFlags.Value */ & ~788968 /* SymbolFlags.Type */)) {
51277
+ var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* SymbolFlags.NamespaceModule */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
51266
51278
  if (symbol) {
51267
51279
  error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, ts.unescapeLeadingUnderscores(name));
51268
51280
  return true;
51269
51281
  }
51270
51282
  }
51271
- else if (meaning & (788968 /* SymbolFlags.Type */ & ~1024 /* SymbolFlags.NamespaceModule */ & ~111551 /* SymbolFlags.Value */)) {
51272
- var symbol = resolveSymbol(resolveName(errorLocation, name, (512 /* SymbolFlags.ValueModule */ | 1024 /* SymbolFlags.NamespaceModule */) & ~788968 /* SymbolFlags.Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
51283
+ else if (meaning & (788968 /* SymbolFlags.Type */ & ~111551 /* SymbolFlags.Value */)) {
51284
+ var symbol = resolveSymbol(resolveName(errorLocation, name, 1536 /* SymbolFlags.Module */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
51273
51285
  if (symbol) {
51274
51286
  error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, ts.unescapeLeadingUnderscores(name));
51275
51287
  return true;
@@ -51859,6 +51871,52 @@ var ts;
51859
51871
  }
51860
51872
  return undefined;
51861
51873
  }
51874
+ /**
51875
+ * Gets combined flags of a `symbol` and all alias targets it resolves to. `resolveAlias`
51876
+ * is typically recursive over chains of aliases, but stops mid-chain if an alias is merged
51877
+ * with another exported symbol, e.g.
51878
+ * ```ts
51879
+ * // a.ts
51880
+ * export const a = 0;
51881
+ * // b.ts
51882
+ * export { a } from "./a";
51883
+ * export type a = number;
51884
+ * // c.ts
51885
+ * import { a } from "./b";
51886
+ * ```
51887
+ * Calling `resolveAlias` on the `a` in c.ts would stop at the merged symbol exported
51888
+ * from b.ts, even though there is still more alias to resolve. Consequently, if we were
51889
+ * trying to determine if the `a` in c.ts has a value meaning, looking at the flags on
51890
+ * the local symbol and on the symbol returned by `resolveAlias` is not enough.
51891
+ * @returns SymbolFlags.All if `symbol` is an alias that ultimately resolves to `unknown`;
51892
+ * combined flags of all alias targets otherwise.
51893
+ */
51894
+ function getAllSymbolFlags(symbol) {
51895
+ var flags = symbol.flags;
51896
+ var seenSymbols;
51897
+ while (symbol.flags & 2097152 /* SymbolFlags.Alias */) {
51898
+ var target = resolveAlias(symbol);
51899
+ if (target === unknownSymbol) {
51900
+ return 67108863 /* SymbolFlags.All */;
51901
+ }
51902
+ // Optimizations - try to avoid creating or adding to
51903
+ // `seenSymbols` if possible
51904
+ if (target === symbol || (seenSymbols === null || seenSymbols === void 0 ? void 0 : seenSymbols.has(target))) {
51905
+ break;
51906
+ }
51907
+ if (target.flags & 2097152 /* SymbolFlags.Alias */) {
51908
+ if (seenSymbols) {
51909
+ seenSymbols.add(target);
51910
+ }
51911
+ else {
51912
+ seenSymbols = new ts.Set([symbol, target]);
51913
+ }
51914
+ }
51915
+ flags |= target.flags;
51916
+ symbol = target;
51917
+ }
51918
+ return flags;
51919
+ }
51862
51920
  /**
51863
51921
  * Marks a symbol as type-only if its declaration is syntactically type-only.
51864
51922
  * If it is not itself marked type-only, but resolves to a type-only alias
@@ -51904,19 +51962,25 @@ var ts;
51904
51962
  return !!aliasDeclarationLinks.typeOnlyDeclaration;
51905
51963
  }
51906
51964
  /** Indicates that a symbol directly or indirectly resolves to a type-only import or export. */
51907
- function getTypeOnlyAliasDeclaration(symbol) {
51965
+ function getTypeOnlyAliasDeclaration(symbol, include) {
51908
51966
  if (!(symbol.flags & 2097152 /* SymbolFlags.Alias */)) {
51909
51967
  return undefined;
51910
51968
  }
51911
51969
  var links = getSymbolLinks(symbol);
51912
- return links.typeOnlyDeclaration || undefined;
51970
+ if (include === undefined) {
51971
+ return links.typeOnlyDeclaration || undefined;
51972
+ }
51973
+ if (links.typeOnlyDeclaration) {
51974
+ return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : undefined;
51975
+ }
51976
+ return undefined;
51913
51977
  }
51914
51978
  function markExportAsReferenced(node) {
51915
51979
  var symbol = getSymbolOfNode(node);
51916
51980
  var target = resolveAlias(symbol);
51917
51981
  if (target) {
51918
51982
  var markAlias = target === unknownSymbol ||
51919
- ((target.flags & 111551 /* SymbolFlags.Value */) && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol));
51983
+ ((getAllSymbolFlags(target) & 111551 /* SymbolFlags.Value */) && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* SymbolFlags.Value */));
51920
51984
  if (markAlias) {
51921
51985
  markAliasSymbolAsReferenced(symbol);
51922
51986
  }
@@ -51936,8 +52000,7 @@ var ts;
51936
52000
  // This way a chain of imports can be elided if ultimately the final input is only used in a type
51937
52001
  // position.
51938
52002
  if (ts.isInternalModuleImportEqualsDeclaration(node)) {
51939
- var target = resolveSymbol(symbol);
51940
- if (target === unknownSymbol || target.flags & 111551 /* SymbolFlags.Value */) {
52003
+ if (getAllSymbolFlags(resolveSymbol(symbol)) & 111551 /* SymbolFlags.Value */) {
51941
52004
  // import foo = <symbol>
51942
52005
  checkExpressionCached(node.moduleReference);
51943
52006
  }
@@ -52759,7 +52822,7 @@ var ts;
52759
52822
  }
52760
52823
  function symbolIsValue(symbol, includeTypeOnlyMembers) {
52761
52824
  return !!(symbol.flags & 111551 /* SymbolFlags.Value */ ||
52762
- symbol.flags & 2097152 /* SymbolFlags.Alias */ && resolveAlias(symbol).flags & 111551 /* SymbolFlags.Value */ && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
52825
+ symbol.flags & 2097152 /* SymbolFlags.Alias */ && getAllSymbolFlags(symbol) & 111551 /* SymbolFlags.Value */ && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
52763
52826
  }
52764
52827
  function findConstructorDeclaration(node) {
52765
52828
  var members = node.members;
@@ -53028,8 +53091,10 @@ var ts;
53028
53091
  return true;
53029
53092
  }
53030
53093
  // Qualify if the symbol from symbol table has same meaning as expected
53031
- symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* SymbolFlags.Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 278 /* SyntaxKind.ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
53032
- if (symbolFromSymbolTable.flags & meaning) {
53094
+ var shouldResolveAlias = (symbolFromSymbolTable.flags & 2097152 /* SymbolFlags.Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 278 /* SyntaxKind.ExportSpecifier */));
53095
+ symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
53096
+ var flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
53097
+ if (flags & meaning) {
53033
53098
  qualify = true;
53034
53099
  return true;
53035
53100
  }
@@ -55686,7 +55751,7 @@ var ts;
55686
55751
  return !symbol.exports ? [] : ts.filter(ts.arrayFrom(symbol.exports.values()), isNamespaceMember);
55687
55752
  }
55688
55753
  function isTypeOnlyNamespace(symbol) {
55689
- return ts.every(getNamespaceMembersForSerialization(symbol), function (m) { return !(resolveSymbol(m).flags & 111551 /* SymbolFlags.Value */); });
55754
+ return ts.every(getNamespaceMembersForSerialization(symbol), function (m) { return !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* SymbolFlags.Value */); });
55690
55755
  }
55691
55756
  function serializeModule(symbol, symbolName, modifierFlags) {
55692
55757
  var members = getNamespaceMembersForSerialization(symbol);
@@ -57600,32 +57665,16 @@ var ts;
57600
57665
  return getTypeFromTypeNode(typeNode);
57601
57666
  }
57602
57667
  }
57603
- function isParameterOfContextSensitiveSignature(symbol) {
57604
- var decl = symbol.valueDeclaration;
57605
- if (!decl) {
57606
- return false;
57607
- }
57608
- if (ts.isBindingElement(decl)) {
57609
- decl = ts.walkUpBindingElementsAndPatterns(decl);
57610
- }
57611
- if (ts.isParameter(decl)) {
57612
- return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent);
57613
- }
57614
- return false;
57615
- }
57616
57668
  function getTypeOfVariableOrParameterOrProperty(symbol) {
57617
57669
  var links = getSymbolLinks(symbol);
57618
57670
  if (!links.type) {
57619
57671
  var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
57620
57672
  // For a contextually typed parameter it is possible that a type has already
57621
57673
  // been assigned (in assignTypeToParameterAndFixTypeParameters), and we want
57622
- // to preserve this type. In fact, we need to _prefer_ that type, but it won't
57623
- // be assigned until contextual typing is complete, so we need to defer in
57624
- // cases where contextual typing may take place.
57625
- if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
57674
+ // to preserve this type.
57675
+ if (!links.type) {
57626
57676
  links.type = type;
57627
57677
  }
57628
- return type;
57629
57678
  }
57630
57679
  return links.type;
57631
57680
  }
@@ -57922,7 +57971,7 @@ var ts;
57922
57971
  links.type = (exportSymbol === null || exportSymbol === void 0 ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol)
57923
57972
  : isDuplicatedCommonJSExport(symbol.declarations) ? autoType
57924
57973
  : declaredType ? declaredType
57925
- : targetSymbol.flags & 111551 /* SymbolFlags.Value */ ? getTypeOfSymbol(targetSymbol)
57974
+ : getAllSymbolFlags(targetSymbol) & 111551 /* SymbolFlags.Value */ ? getTypeOfSymbol(targetSymbol)
57926
57975
  : errorType;
57927
57976
  }
57928
57977
  return links.type;
@@ -60275,7 +60324,7 @@ var ts;
60275
60324
  var indexTypes;
60276
60325
  var isUnion = containingType.flags & 1048576 /* TypeFlags.Union */;
60277
60326
  // Flags we want to propagate to the result if they exist in all source symbols
60278
- var optionalFlag = isUnion ? 0 /* SymbolFlags.None */ : 16777216 /* SymbolFlags.Optional */;
60327
+ var optionalFlag;
60279
60328
  var syntheticFlag = 4 /* CheckFlags.SyntheticMethod */;
60280
60329
  var checkFlags = isUnion ? 0 : 8 /* CheckFlags.Readonly */;
60281
60330
  var mergedInstantiations = false;
@@ -60286,11 +60335,14 @@ var ts;
60286
60335
  var prop = getPropertyOfType(type, name, skipObjectFunctionPropertyAugment);
60287
60336
  var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
60288
60337
  if (prop) {
60289
- if (isUnion) {
60290
- optionalFlag |= (prop.flags & 16777216 /* SymbolFlags.Optional */);
60291
- }
60292
- else {
60293
- optionalFlag &= prop.flags;
60338
+ if (prop.flags & 106500 /* SymbolFlags.ClassMember */) {
60339
+ optionalFlag !== null && optionalFlag !== void 0 ? optionalFlag : (optionalFlag = isUnion ? 0 /* SymbolFlags.None */ : 16777216 /* SymbolFlags.Optional */);
60340
+ if (isUnion) {
60341
+ optionalFlag |= (prop.flags & 16777216 /* SymbolFlags.Optional */);
60342
+ }
60343
+ else {
60344
+ optionalFlag &= prop.flags;
60345
+ }
60294
60346
  }
60295
60347
  if (!singleProp) {
60296
60348
  singleProp = prop;
@@ -60409,7 +60461,7 @@ var ts;
60409
60461
  propTypes.push(type);
60410
60462
  }
60411
60463
  ts.addRange(propTypes, indexTypes);
60412
- var result = createSymbol(4 /* SymbolFlags.Property */ | optionalFlag, name, syntheticFlag | checkFlags);
60464
+ var result = createSymbol(4 /* SymbolFlags.Property */ | (optionalFlag !== null && optionalFlag !== void 0 ? optionalFlag : 0), name, syntheticFlag | checkFlags);
60413
60465
  result.containingType = containingType;
60414
60466
  if (!hasNonUniformValueDeclaration && firstValueDeclaration) {
60415
60467
  result.valueDeclaration = firstValueDeclaration;
@@ -67676,7 +67728,7 @@ var ts;
67676
67728
  return 0 /* Ternary.False */;
67677
67729
  }
67678
67730
  // When checking for comparability, be more lenient with optional properties.
67679
- if (!skipOptional && sourceProp.flags & 16777216 /* SymbolFlags.Optional */ && !(targetProp.flags & 16777216 /* SymbolFlags.Optional */)) {
67731
+ if (!skipOptional && sourceProp.flags & 16777216 /* SymbolFlags.Optional */ && targetProp.flags & 106500 /* SymbolFlags.ClassMember */ && !(targetProp.flags & 16777216 /* SymbolFlags.Optional */)) {
67680
67732
  // TypeScript 1.0 spec (April 2014): 3.8.3
67681
67733
  // S is a subtype of a type T, and T is a supertype of S if ...
67682
67734
  // S' and T are object types and, for each member M in T..
@@ -72948,9 +73000,9 @@ var ts;
72948
73000
  });
72949
73001
  }
72950
73002
  function markAliasReferenced(symbol, location) {
72951
- if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* SymbolFlags.Value */) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol)) {
73003
+ if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* SymbolFlags.Value */) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* SymbolFlags.Value */)) {
72952
73004
  var target = resolveAlias(symbol);
72953
- if (target.flags & 111551 /* SymbolFlags.Value */) {
73005
+ if (getAllSymbolFlags(target) & 111551 /* SymbolFlags.Value */) {
72954
73006
  // An alias resolving to a const enum cannot be elided if (1) 'isolatedModules' is enabled
72955
73007
  // (because the const enum value will not be inlined), or if (2) the alias is an export
72956
73008
  // of a const enum declaration that will be preserved.
@@ -74366,9 +74418,10 @@ var ts;
74366
74418
  function instantiateContextualType(contextualType, node, contextFlags) {
74367
74419
  if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* TypeFlags.Instantiable */)) {
74368
74420
  var inferenceContext = getInferenceContext(node);
74369
- // If no inferences have been made, nothing is gained from instantiating as type parameters
74370
- // would just be replaced with their defaults similar to the apparent type.
74371
- if (inferenceContext && contextFlags & 1 /* ContextFlags.Signature */ && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {
74421
+ // If no inferences have been made, and none of the type parameters for which we are inferring
74422
+ // specify default types, nothing is gained from instantiating as type parameters would just be
74423
+ // replaced with their constraints similar to the apparent type.
74424
+ if (inferenceContext && contextFlags & 1 /* ContextFlags.Signature */ && ts.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
74372
74425
  // For contextual signatures we incorporate all inferences made so far, e.g. from return
74373
74426
  // types as well as arguments to the left in a function call.
74374
74427
  return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
@@ -78842,7 +78895,7 @@ var ts;
78842
78895
  if (symbol && symbol.flags & 2097152 /* SymbolFlags.Alias */) {
78843
78896
  symbol = resolveAlias(symbol);
78844
78897
  }
78845
- return !!(symbol && (symbol.flags & 384 /* SymbolFlags.Enum */) && getEnumKind(symbol) === 1 /* EnumKind.Literal */);
78898
+ return !!(symbol && (getAllSymbolFlags(symbol) & 384 /* SymbolFlags.Enum */) && getEnumKind(symbol) === 1 /* EnumKind.Literal */);
78846
78899
  }
78847
78900
  return false;
78848
78901
  }
@@ -81216,6 +81269,9 @@ var ts;
81216
81269
  function hasInferenceCandidates(info) {
81217
81270
  return !!(info.candidates || info.contraCandidates);
81218
81271
  }
81272
+ function hasInferenceCandidatesOrDefault(info) {
81273
+ return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
81274
+ }
81219
81275
  function hasOverlappingInferences(a, b) {
81220
81276
  for (var i = 0; i < a.length; i++) {
81221
81277
  if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
@@ -85017,7 +85073,16 @@ var ts;
85017
85073
  var message = allowAsyncIterables
85018
85074
  ? ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator
85019
85075
  : ts.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;
85020
- return errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), message, typeToString(type));
85076
+ var suggestAwait =
85077
+ // for (const x of Promise<...>) or [...Promise<...>]
85078
+ !!getAwaitedTypeOfPromise(type)
85079
+ // for (const x of AsyncIterable<...>)
85080
+ || (!allowAsyncIterables &&
85081
+ ts.isForOfStatement(errorNode.parent) &&
85082
+ errorNode.parent.expression === errorNode &&
85083
+ getGlobalAsyncIterableType(/** reportErrors */ false) !== emptyGenericType &&
85084
+ isTypeAssignableTo(type, getGlobalAsyncIterableType(/** reportErrors */ false)));
85085
+ return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type));
85021
85086
  }
85022
85087
  /**
85023
85088
  * Gets the *yield*, *return*, and *next* types from an `Iterator`-like or `AsyncIterator`-like type.
@@ -86868,10 +86933,11 @@ var ts;
86868
86933
  }
86869
86934
  return;
86870
86935
  }
86936
+ var targetFlags = getAllSymbolFlags(target);
86871
86937
  var excludedMeanings = (symbol.flags & (111551 /* SymbolFlags.Value */ | 1048576 /* SymbolFlags.ExportValue */) ? 111551 /* SymbolFlags.Value */ : 0) |
86872
86938
  (symbol.flags & 788968 /* SymbolFlags.Type */ ? 788968 /* SymbolFlags.Type */ : 0) |
86873
86939
  (symbol.flags & 1920 /* SymbolFlags.Namespace */ ? 1920 /* SymbolFlags.Namespace */ : 0);
86874
- if (target.flags & excludedMeanings) {
86940
+ if (targetFlags & excludedMeanings) {
86875
86941
  var message = node.kind === 278 /* SyntaxKind.ExportSpecifier */ ?
86876
86942
  ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
86877
86943
  ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
@@ -86881,7 +86947,7 @@ var ts;
86881
86947
  && !ts.isTypeOnlyImportOrExportDeclaration(node)
86882
86948
  && !(node.flags & 16777216 /* NodeFlags.Ambient */)) {
86883
86949
  var typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
86884
- var isType = !(target.flags & 111551 /* SymbolFlags.Value */);
86950
+ var isType = !(targetFlags & 111551 /* SymbolFlags.Value */);
86885
86951
  if (isType || typeOnlyAlias) {
86886
86952
  switch (node.kind) {
86887
86953
  case 270 /* SyntaxKind.ImportClause */:
@@ -87041,14 +87107,15 @@ var ts;
87041
87107
  if (node.moduleReference.kind !== 280 /* SyntaxKind.ExternalModuleReference */) {
87042
87108
  var target = resolveAlias(getSymbolOfNode(node));
87043
87109
  if (target !== unknownSymbol) {
87044
- if (target.flags & 111551 /* SymbolFlags.Value */) {
87110
+ var targetFlags = getAllSymbolFlags(target);
87111
+ if (targetFlags & 111551 /* SymbolFlags.Value */) {
87045
87112
  // Target is a value symbol, check that it is not hidden by a local declaration with the same name
87046
87113
  var moduleName = ts.getFirstIdentifier(node.moduleReference);
87047
87114
  if (!(resolveEntityName(moduleName, 111551 /* SymbolFlags.Value */ | 1920 /* SymbolFlags.Namespace */).flags & 1920 /* SymbolFlags.Namespace */)) {
87048
87115
  error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName));
87049
87116
  }
87050
87117
  }
87051
- if (target.flags & 788968 /* SymbolFlags.Type */) {
87118
+ if (targetFlags & 788968 /* SymbolFlags.Type */) {
87052
87119
  checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0);
87053
87120
  }
87054
87121
  }
@@ -87187,7 +87254,7 @@ var ts;
87187
87254
  markExportAsReferenced(node);
87188
87255
  }
87189
87256
  var target = symbol && (symbol.flags & 2097152 /* SymbolFlags.Alias */ ? resolveAlias(symbol) : symbol);
87190
- if (!target || target === unknownSymbol || target.flags & 111551 /* SymbolFlags.Value */) {
87257
+ if (!target || getAllSymbolFlags(target) & 111551 /* SymbolFlags.Value */) {
87191
87258
  checkExpressionCached(node.propertyName || node.name);
87192
87259
  }
87193
87260
  }
@@ -87234,7 +87301,7 @@ var ts;
87234
87301
  markAliasReferenced(sym, id);
87235
87302
  // If not a value, we're interpreting the identifier as a type export, along the lines of (`export { Id as default }`)
87236
87303
  var target = sym.flags & 2097152 /* SymbolFlags.Alias */ ? resolveAlias(sym) : sym;
87237
- if (target === unknownSymbol || target.flags & 111551 /* SymbolFlags.Value */) {
87304
+ if (getAllSymbolFlags(target) & 111551 /* SymbolFlags.Value */) {
87238
87305
  // However if it is a value, we need to check it's being used correctly
87239
87306
  checkExpressionCached(node.expression);
87240
87307
  }
@@ -88556,7 +88623,7 @@ var ts;
88556
88623
  return symbolLinks.exportsSomeValue;
88557
88624
  function isValue(s) {
88558
88625
  s = resolveSymbol(s);
88559
- return s && !!(s.flags & 111551 /* SymbolFlags.Value */);
88626
+ return s && !!(getAllSymbolFlags(s) & 111551 /* SymbolFlags.Value */);
88560
88627
  }
88561
88628
  }
88562
88629
  function isNameOfModuleOrEnumDeclaration(node) {
@@ -88609,7 +88676,7 @@ var ts;
88609
88676
  var symbol = getReferencedValueOrAliasSymbol(node);
88610
88677
  // We should only get the declaration of an alias if there isn't a local value
88611
88678
  // declaration for the symbol
88612
- if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* SymbolFlags.Value */) && !getTypeOnlyAliasDeclaration(symbol)) {
88679
+ if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* SymbolFlags.Value */) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* SymbolFlags.Value */)) {
88613
88680
  return getDeclarationOfAliasSymbol(symbol);
88614
88681
  }
88615
88682
  }
@@ -88697,7 +88764,7 @@ var ts;
88697
88764
  case 273 /* SyntaxKind.ImportSpecifier */:
88698
88765
  case 278 /* SyntaxKind.ExportSpecifier */:
88699
88766
  var symbol = getSymbolOfNode(node);
88700
- return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol);
88767
+ return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* SymbolFlags.Value */);
88701
88768
  case 275 /* SyntaxKind.ExportDeclaration */:
88702
88769
  var exportClause = node.exportClause;
88703
88770
  return !!exportClause && (ts.isNamespaceExport(exportClause) ||
@@ -88719,6 +88786,7 @@ var ts;
88719
88786
  return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference);
88720
88787
  }
88721
88788
  function isAliasResolvedToValue(symbol) {
88789
+ var _a;
88722
88790
  if (!symbol) {
88723
88791
  return false;
88724
88792
  }
@@ -88728,7 +88796,7 @@ var ts;
88728
88796
  }
88729
88797
  // const enums and modules that contain only const enums are not considered values from the emit perspective
88730
88798
  // unless 'preserveConstEnums' option is set to true
88731
- return !!(target.flags & 111551 /* SymbolFlags.Value */) &&
88799
+ return !!(((_a = getAllSymbolFlags(target)) !== null && _a !== void 0 ? _a : -1) & 111551 /* SymbolFlags.Value */) &&
88732
88800
  (ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
88733
88801
  }
88734
88802
  function isConstEnumOrConstEnumOnlyModule(s) {
@@ -88743,7 +88811,7 @@ var ts;
88743
88811
  }
88744
88812
  var target = getSymbolLinks(symbol).aliasTarget; // TODO: GH#18217
88745
88813
  if (target && ts.getEffectiveModifierFlags(node) & 1 /* ModifierFlags.Export */ &&
88746
- target.flags & 111551 /* SymbolFlags.Value */ &&
88814
+ getAllSymbolFlags(target) & 111551 /* SymbolFlags.Value */ &&
88747
88815
  (ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
88748
88816
  // An `export import ... =` of a value symbol is always considered referenced
88749
88817
  return true;
@@ -101236,11 +101304,13 @@ var ts;
101236
101304
  return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
101237
101305
  }
101238
101306
  function visitIdentifier(node) {
101239
- if (!convertedLoopState) {
101240
- return node;
101307
+ if (convertedLoopState) {
101308
+ if (resolver.isArgumentsLocalBinding(node)) {
101309
+ return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
101310
+ }
101241
101311
  }
101242
- if (resolver.isArgumentsLocalBinding(node)) {
101243
- return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
101312
+ if (node.hasExtendedUnicodeEscape) {
101313
+ return ts.setOriginalNode(ts.setTextRange(factory.createIdentifier(ts.unescapeLeadingUnderscores(node.escapedText)), node), node);
101244
101314
  }
101245
101315
  return node;
101246
101316
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.9.0-pr-50976-13",
5
+ "version": "4.9.0-pr-51026-8",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -89,7 +89,7 @@
89
89
  "ms": "^2.1.3",
90
90
  "node-fetch": "^2.6.7",
91
91
  "source-map-support": "latest",
92
- "typescript": "^4.8.3",
92
+ "typescript": "^4.8.4",
93
93
  "vinyl": "latest",
94
94
  "which": "^2.0.2",
95
95
  "xml2js": "^0.4.23"
package/lib/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Read This!
2
-
3
- **These files are not meant to be edited by hand.**
4
- If you need to make modifications, the respective files should be changed within the repository's top-level `src` directory.
5
- Running `gulp LKG` will then appropriately update the files in this directory.
@@ -1,43 +0,0 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation. All rights reserved.
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
- this file except in compliance with the License. You may obtain a copy of the
5
- License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
- MERCHANTABLITY OR NON-INFRINGEMENT.
11
-
12
- See the Apache Version 2.0 License for specific language governing permissions
13
- and limitations under the License.
14
- ***************************************************************************** */
15
-
16
-
17
-
18
- /// <reference no-default-lib="true"/>
19
-
20
-
21
- interface AggregateError extends Error {
22
- errors: any[]
23
- }
24
-
25
- interface AggregateErrorConstructor {
26
- new(errors: Iterable<any>, message?: string): AggregateError;
27
- (errors: Iterable<any>, message?: string): AggregateError;
28
- readonly prototype: AggregateError;
29
- }
30
-
31
- declare var AggregateError: AggregateErrorConstructor;
32
-
33
- /**
34
- * Represents the completion of an asynchronous operation
35
- */
36
- interface PromiseConstructor {
37
- /**
38
- * The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
39
- * @param values An array or iterable of Promises.
40
- * @returns A new Promise.
41
- */
42
- any<T>(values: (T | PromiseLike<T>)[] | Iterable<T | PromiseLike<T>>): Promise<T>
43
- }
@@ -1,35 +0,0 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation. All rights reserved.
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
- this file except in compliance with the License. You may obtain a copy of the
5
- License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
- MERCHANTABLITY OR NON-INFRINGEMENT.
11
-
12
- See the Apache Version 2.0 License for specific language governing permissions
13
- and limitations under the License.
14
- ***************************************************************************** */
15
-
16
-
17
-
18
- /// <reference no-default-lib="true"/>
19
-
20
-
21
- interface String {
22
- /**
23
- * Replace all instances of a substring in a string, using a regular expression or search string.
24
- * @param searchValue A string to search for.
25
- * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
26
- */
27
- replaceAll(searchValue: string | RegExp, replaceValue: string): string;
28
-
29
- /**
30
- * Replace all instances of a substring in a string, using a regular expression or search string.
31
- * @param searchValue A string to search for.
32
- * @param replacer A function that returns the replacement text.
33
- */
34
- replaceAll(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
35
- }