@typescript-deploys/pr-build 5.5.0-pr-58650-7 → 5.5.0-pr-57201-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -9693,25 +9693,19 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9693
9693
  }
9694
9694
  function reScanSlashToken(reportErrors2) {
9695
9695
  if (token === 44 /* SlashToken */ || token === 69 /* SlashEqualsToken */) {
9696
- let p = tokenStart + 1;
9696
+ const startOfRegExpBody = tokenStart + 1;
9697
+ pos = startOfRegExpBody;
9697
9698
  let inEscape = false;
9698
9699
  let inCharacterClass = false;
9699
9700
  while (true) {
9700
- if (p >= end) {
9701
- tokenFlags |= 4 /* Unterminated */;
9702
- error(Diagnostics.Unterminated_regular_expression_literal);
9703
- break;
9704
- }
9705
- const ch = charCodeUnchecked(p);
9706
- if (isLineBreak(ch)) {
9701
+ const ch = charCodeChecked(pos);
9702
+ if (ch === -1 /* EOF */ || isLineBreak(ch)) {
9707
9703
  tokenFlags |= 4 /* Unterminated */;
9708
- error(Diagnostics.Unterminated_regular_expression_literal);
9709
9704
  break;
9710
9705
  }
9711
9706
  if (inEscape) {
9712
9707
  inEscape = false;
9713
9708
  } else if (ch === 47 /* slash */ && !inCharacterClass) {
9714
- p++;
9715
9709
  break;
9716
9710
  } else if (ch === 91 /* openBracket */) {
9717
9711
  inCharacterClass = true;
@@ -9720,59 +9714,86 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9720
9714
  } else if (ch === 93 /* closeBracket */) {
9721
9715
  inCharacterClass = false;
9722
9716
  }
9723
- p++;
9717
+ pos++;
9724
9718
  }
9725
- const isUnterminated = !!(tokenFlags & 4 /* Unterminated */);
9726
- const endOfBody = p - (isUnterminated ? 0 : 1);
9727
- let regExpFlags = 0 /* None */;
9728
- while (p < end) {
9729
- const ch = charCodeUnchecked(p);
9730
- if (!isIdentifierPart(ch, languageVersion)) {
9731
- break;
9719
+ const endOfRegExpBody = pos;
9720
+ if (tokenFlags & 4 /* Unterminated */) {
9721
+ pos = startOfRegExpBody;
9722
+ inEscape = false;
9723
+ let characterClassDepth = 0;
9724
+ let inDecimalQuantifier = false;
9725
+ let groupDepth = 0;
9726
+ while (pos < endOfRegExpBody) {
9727
+ const ch = charCodeUnchecked(pos);
9728
+ if (inEscape) {
9729
+ inEscape = false;
9730
+ } else if (ch === 92 /* backslash */) {
9731
+ inEscape = true;
9732
+ } else if (ch === 91 /* openBracket */) {
9733
+ characterClassDepth++;
9734
+ } else if (ch === 93 /* closeBracket */ && characterClassDepth) {
9735
+ characterClassDepth--;
9736
+ } else if (!characterClassDepth) {
9737
+ if (ch === 123 /* openBrace */) {
9738
+ inDecimalQuantifier = true;
9739
+ } else if (ch === 125 /* closeBrace */ && inDecimalQuantifier) {
9740
+ inDecimalQuantifier = false;
9741
+ } else if (!inDecimalQuantifier) {
9742
+ if (ch === 40 /* openParen */) {
9743
+ groupDepth++;
9744
+ } else if (ch === 41 /* closeParen */ && groupDepth) {
9745
+ groupDepth--;
9746
+ } else if (ch === 41 /* closeParen */ || ch === 93 /* closeBracket */ || ch === 125 /* closeBrace */) {
9747
+ break;
9748
+ }
9749
+ }
9750
+ }
9751
+ pos++;
9732
9752
  }
9733
- if (reportErrors2) {
9734
- const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
9735
- if (flag === void 0) {
9736
- error(Diagnostics.Unknown_regular_expression_flag, p, 1);
9737
- } else if (regExpFlags & flag) {
9738
- error(Diagnostics.Duplicate_regular_expression_flag, p, 1);
9739
- } else if (((regExpFlags | flag) & 96 /* UnicodeMode */) === 96 /* UnicodeMode */) {
9740
- error(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1);
9741
- } else {
9742
- regExpFlags |= flag;
9743
- checkRegularExpressionFlagAvailable(flag, p);
9753
+ while (isWhiteSpaceLike(charCodeChecked(pos - 1)) || charCodeChecked(pos - 1) === 59 /* semicolon */) pos--;
9754
+ error(Diagnostics.Unterminated_regular_expression_literal, tokenStart, pos - tokenStart);
9755
+ } else {
9756
+ pos++;
9757
+ let regExpFlags = 0 /* None */;
9758
+ while (true) {
9759
+ const ch = codePointChecked(pos);
9760
+ if (ch === -1 /* EOF */ || !isIdentifierPart(ch, languageVersion)) {
9761
+ break;
9744
9762
  }
9763
+ if (reportErrors2) {
9764
+ const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
9765
+ if (flag === void 0) {
9766
+ error(Diagnostics.Unknown_regular_expression_flag, pos, 1);
9767
+ } else if (regExpFlags & flag) {
9768
+ error(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
9769
+ } else if (((regExpFlags | flag) & 96 /* AnyUnicodeMode */) === 96 /* AnyUnicodeMode */) {
9770
+ error(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, pos, 1);
9771
+ } else {
9772
+ regExpFlags |= flag;
9773
+ checkRegularExpressionFlagAvailable(flag, pos);
9774
+ }
9775
+ }
9776
+ pos++;
9777
+ }
9778
+ if (reportErrors2) {
9779
+ scanRange(startOfRegExpBody, endOfRegExpBody - startOfRegExpBody, () => {
9780
+ scanRegularExpressionWorker(
9781
+ regExpFlags,
9782
+ /*annexB*/
9783
+ true
9784
+ );
9785
+ });
9745
9786
  }
9746
- p++;
9747
- }
9748
- pos = p;
9749
- if (reportErrors2) {
9750
- const saveTokenStart = tokenStart;
9751
- const saveTokenFlags = tokenFlags;
9752
- const savePos = pos;
9753
- const saveEnd = end;
9754
- pos = tokenStart + 1;
9755
- end = endOfBody;
9756
- scanRegularExpressionWorker(
9757
- regExpFlags,
9758
- isUnterminated,
9759
- /*annexB*/
9760
- true
9761
- );
9762
- tokenStart = saveTokenStart;
9763
- tokenFlags = saveTokenFlags;
9764
- pos = savePos;
9765
- end = saveEnd;
9766
9787
  }
9767
9788
  tokenValue = text.substring(tokenStart, pos);
9768
9789
  token = 14 /* RegularExpressionLiteral */;
9769
9790
  }
9770
9791
  return token;
9771
9792
  }
9772
- function scanRegularExpressionWorker(regExpFlags, isUnterminated, annexB) {
9793
+ function scanRegularExpressionWorker(regExpFlags, annexB) {
9773
9794
  var unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */);
9774
- var unicodeMode = !!(regExpFlags & 96 /* UnicodeMode */);
9775
- if (unicodeMode) {
9795
+ var anyUnicodeMode = !!(regExpFlags & 96 /* AnyUnicodeMode */);
9796
+ if (anyUnicodeMode) {
9776
9797
  annexB = false;
9777
9798
  }
9778
9799
  var mayContainStrings = false;
@@ -9891,7 +9912,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9891
9912
  if (max || charCodeChecked(pos) === 125 /* closeBrace */) {
9892
9913
  error(Diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0);
9893
9914
  } else {
9894
- if (unicodeMode) {
9915
+ if (anyUnicodeMode) {
9895
9916
  error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
9896
9917
  }
9897
9918
  isPreviousTermQuantifiable = true;
@@ -9902,7 +9923,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9902
9923
  error(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart);
9903
9924
  }
9904
9925
  } else if (!min2) {
9905
- if (unicodeMode) {
9926
+ if (anyUnicodeMode) {
9906
9927
  error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
9907
9928
  }
9908
9929
  isPreviousTermQuantifiable = true;
@@ -9942,10 +9963,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9942
9963
  }
9943
9964
  case 93 /* closeBracket */:
9944
9965
  case 125 /* closeBrace */:
9945
- if (isUnterminated && !isInGroup) {
9946
- return;
9947
- }
9948
- if (unicodeMode || ch === 41 /* closeParen */) {
9966
+ if (anyUnicodeMode || ch === 41 /* closeParen */) {
9949
9967
  error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
9950
9968
  }
9951
9969
  pos++;
@@ -9994,7 +10012,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9994
10012
  true
9995
10013
  );
9996
10014
  scanExpectedChar(62 /* greaterThan */);
9997
- } else if (unicodeMode) {
10015
+ } else if (anyUnicodeMode) {
9998
10016
  error(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2);
9999
10017
  }
10000
10018
  break;
@@ -10027,6 +10045,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10027
10045
  Debug.assertEqual(charCodeUnchecked(pos - 1), 92 /* backslash */);
10028
10046
  let ch = charCodeChecked(pos);
10029
10047
  switch (ch) {
10048
+ case -1 /* EOF */:
10049
+ error(Diagnostics.Undetermined_character_escape, pos - 1, 1);
10050
+ return "\\";
10030
10051
  case 99 /* c */:
10031
10052
  pos++;
10032
10053
  ch = charCodeChecked(pos);
@@ -10034,7 +10055,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10034
10055
  pos++;
10035
10056
  return String.fromCharCode(ch & 31);
10036
10057
  }
10037
- if (unicodeMode) {
10058
+ if (anyUnicodeMode) {
10038
10059
  error(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2);
10039
10060
  } else if (atomEscape && annexB) {
10040
10061
  pos--;
@@ -10059,14 +10080,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10059
10080
  pos++;
10060
10081
  return String.fromCharCode(ch);
10061
10082
  default:
10062
- if (pos >= end) {
10063
- error(Diagnostics.Undetermined_character_escape, pos - 1, 1);
10064
- return "\\";
10065
- }
10066
10083
  pos--;
10067
10084
  return scanEscapeSequence(
10068
10085
  /*shouldEmitInvalidEscapeError*/
10069
- unicodeMode,
10086
+ anyUnicodeMode,
10070
10087
  /*isRegularExpression*/
10071
10088
  annexB ? "annex-b" : true
10072
10089
  );
@@ -10542,10 +10559,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10542
10559
  }
10543
10560
  }
10544
10561
  scanExpectedChar(125 /* closeBrace */);
10545
- if (!unicodeMode) {
10562
+ if (!anyUnicodeMode) {
10546
10563
  error(Diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start2, pos - start2);
10547
10564
  }
10548
- } else if (unicodeMode) {
10565
+ } else if (anyUnicodeMode) {
10549
10566
  error(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch));
10550
10567
  }
10551
10568
  return true;
@@ -10565,7 +10582,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10565
10582
  return value;
10566
10583
  }
10567
10584
  function scanSourceCharacter() {
10568
- const size = unicodeMode ? charSize(charCodeChecked(pos)) : 1;
10585
+ const size = anyUnicodeMode ? charSize(charCodeChecked(pos)) : 1;
10569
10586
  pos += size;
10570
10587
  return size > 0 ? text.substring(pos - size, pos) : "";
10571
10588
  }
@@ -28415,10 +28432,7 @@ var Parser;
28415
28432
  function parseErrorAtPosition(start, length2, message, ...args) {
28416
28433
  const lastError = lastOrUndefined(parseDiagnostics);
28417
28434
  let result;
28418
- if (message.category === 3 /* Message */ && lastError && start === lastError.start && length2 === lastError.length) {
28419
- result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
28420
- addRelatedInfo(lastError, result);
28421
- } else if (!lastError || start !== lastError.start) {
28435
+ if (!lastError || start !== lastError.start) {
28422
28436
  result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
28423
28437
  parseDiagnostics.push(result);
28424
28438
  }
@@ -65733,17 +65747,12 @@ function createTypeChecker(host) {
65733
65747
  }
65734
65748
  }
65735
65749
  function applyToReturnTypes(source, target, callback) {
65750
+ const sourceTypePredicate = getTypePredicateOfSignature(source);
65736
65751
  const targetTypePredicate = getTypePredicateOfSignature(target);
65737
- if (targetTypePredicate) {
65738
- const sourceTypePredicate = getTypePredicateOfSignature(source);
65739
- if (sourceTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) {
65740
- callback(sourceTypePredicate.type, targetTypePredicate.type);
65741
- return;
65742
- }
65743
- }
65744
- const targetReturnType = getReturnTypeOfSignature(target);
65745
- if (couldContainTypeVariables(targetReturnType)) {
65746
- callback(getReturnTypeOfSignature(source), targetReturnType);
65752
+ if (sourceTypePredicate && targetTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) {
65753
+ callback(sourceTypePredicate.type, targetTypePredicate.type);
65754
+ } else {
65755
+ callback(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target));
65747
65756
  }
65748
65757
  }
65749
65758
  function createInferenceContext(typeParameters, signature, flags, compareTypes) {
package/lib/typescript.js CHANGED
@@ -6200,7 +6200,7 @@ var RegularExpressionFlags = /* @__PURE__ */ ((RegularExpressionFlags2) => {
6200
6200
  RegularExpressionFlags2[RegularExpressionFlags2["Unicode"] = 32] = "Unicode";
6201
6201
  RegularExpressionFlags2[RegularExpressionFlags2["UnicodeSets"] = 64] = "UnicodeSets";
6202
6202
  RegularExpressionFlags2[RegularExpressionFlags2["Sticky"] = 128] = "Sticky";
6203
- RegularExpressionFlags2[RegularExpressionFlags2["UnicodeMode"] = 96] = "UnicodeMode";
6203
+ RegularExpressionFlags2[RegularExpressionFlags2["AnyUnicodeMode"] = 96] = "AnyUnicodeMode";
6204
6204
  RegularExpressionFlags2[RegularExpressionFlags2["Modifiers"] = 28] = "Modifiers";
6205
6205
  return RegularExpressionFlags2;
6206
6206
  })(RegularExpressionFlags || {});
@@ -13326,25 +13326,19 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13326
13326
  }
13327
13327
  function reScanSlashToken(reportErrors2) {
13328
13328
  if (token === 44 /* SlashToken */ || token === 69 /* SlashEqualsToken */) {
13329
- let p = tokenStart + 1;
13329
+ const startOfRegExpBody = tokenStart + 1;
13330
+ pos = startOfRegExpBody;
13330
13331
  let inEscape = false;
13331
13332
  let inCharacterClass = false;
13332
13333
  while (true) {
13333
- if (p >= end) {
13334
- tokenFlags |= 4 /* Unterminated */;
13335
- error2(Diagnostics.Unterminated_regular_expression_literal);
13336
- break;
13337
- }
13338
- const ch = charCodeUnchecked(p);
13339
- if (isLineBreak(ch)) {
13334
+ const ch = charCodeChecked(pos);
13335
+ if (ch === -1 /* EOF */ || isLineBreak(ch)) {
13340
13336
  tokenFlags |= 4 /* Unterminated */;
13341
- error2(Diagnostics.Unterminated_regular_expression_literal);
13342
13337
  break;
13343
13338
  }
13344
13339
  if (inEscape) {
13345
13340
  inEscape = false;
13346
13341
  } else if (ch === 47 /* slash */ && !inCharacterClass) {
13347
- p++;
13348
13342
  break;
13349
13343
  } else if (ch === 91 /* openBracket */) {
13350
13344
  inCharacterClass = true;
@@ -13353,59 +13347,86 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13353
13347
  } else if (ch === 93 /* closeBracket */) {
13354
13348
  inCharacterClass = false;
13355
13349
  }
13356
- p++;
13350
+ pos++;
13357
13351
  }
13358
- const isUnterminated = !!(tokenFlags & 4 /* Unterminated */);
13359
- const endOfBody = p - (isUnterminated ? 0 : 1);
13360
- let regExpFlags = 0 /* None */;
13361
- while (p < end) {
13362
- const ch = charCodeUnchecked(p);
13363
- if (!isIdentifierPart(ch, languageVersion)) {
13364
- break;
13352
+ const endOfRegExpBody = pos;
13353
+ if (tokenFlags & 4 /* Unterminated */) {
13354
+ pos = startOfRegExpBody;
13355
+ inEscape = false;
13356
+ let characterClassDepth = 0;
13357
+ let inDecimalQuantifier = false;
13358
+ let groupDepth = 0;
13359
+ while (pos < endOfRegExpBody) {
13360
+ const ch = charCodeUnchecked(pos);
13361
+ if (inEscape) {
13362
+ inEscape = false;
13363
+ } else if (ch === 92 /* backslash */) {
13364
+ inEscape = true;
13365
+ } else if (ch === 91 /* openBracket */) {
13366
+ characterClassDepth++;
13367
+ } else if (ch === 93 /* closeBracket */ && characterClassDepth) {
13368
+ characterClassDepth--;
13369
+ } else if (!characterClassDepth) {
13370
+ if (ch === 123 /* openBrace */) {
13371
+ inDecimalQuantifier = true;
13372
+ } else if (ch === 125 /* closeBrace */ && inDecimalQuantifier) {
13373
+ inDecimalQuantifier = false;
13374
+ } else if (!inDecimalQuantifier) {
13375
+ if (ch === 40 /* openParen */) {
13376
+ groupDepth++;
13377
+ } else if (ch === 41 /* closeParen */ && groupDepth) {
13378
+ groupDepth--;
13379
+ } else if (ch === 41 /* closeParen */ || ch === 93 /* closeBracket */ || ch === 125 /* closeBrace */) {
13380
+ break;
13381
+ }
13382
+ }
13383
+ }
13384
+ pos++;
13365
13385
  }
13366
- if (reportErrors2) {
13367
- const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
13368
- if (flag === void 0) {
13369
- error2(Diagnostics.Unknown_regular_expression_flag, p, 1);
13370
- } else if (regExpFlags & flag) {
13371
- error2(Diagnostics.Duplicate_regular_expression_flag, p, 1);
13372
- } else if (((regExpFlags | flag) & 96 /* UnicodeMode */) === 96 /* UnicodeMode */) {
13373
- error2(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1);
13374
- } else {
13375
- regExpFlags |= flag;
13376
- checkRegularExpressionFlagAvailable(flag, p);
13386
+ while (isWhiteSpaceLike(charCodeChecked(pos - 1)) || charCodeChecked(pos - 1) === 59 /* semicolon */) pos--;
13387
+ error2(Diagnostics.Unterminated_regular_expression_literal, tokenStart, pos - tokenStart);
13388
+ } else {
13389
+ pos++;
13390
+ let regExpFlags = 0 /* None */;
13391
+ while (true) {
13392
+ const ch = codePointChecked(pos);
13393
+ if (ch === -1 /* EOF */ || !isIdentifierPart(ch, languageVersion)) {
13394
+ break;
13377
13395
  }
13396
+ if (reportErrors2) {
13397
+ const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
13398
+ if (flag === void 0) {
13399
+ error2(Diagnostics.Unknown_regular_expression_flag, pos, 1);
13400
+ } else if (regExpFlags & flag) {
13401
+ error2(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
13402
+ } else if (((regExpFlags | flag) & 96 /* AnyUnicodeMode */) === 96 /* AnyUnicodeMode */) {
13403
+ error2(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, pos, 1);
13404
+ } else {
13405
+ regExpFlags |= flag;
13406
+ checkRegularExpressionFlagAvailable(flag, pos);
13407
+ }
13408
+ }
13409
+ pos++;
13410
+ }
13411
+ if (reportErrors2) {
13412
+ scanRange(startOfRegExpBody, endOfRegExpBody - startOfRegExpBody, () => {
13413
+ scanRegularExpressionWorker(
13414
+ regExpFlags,
13415
+ /*annexB*/
13416
+ true
13417
+ );
13418
+ });
13378
13419
  }
13379
- p++;
13380
- }
13381
- pos = p;
13382
- if (reportErrors2) {
13383
- const saveTokenStart = tokenStart;
13384
- const saveTokenFlags = tokenFlags;
13385
- const savePos = pos;
13386
- const saveEnd = end;
13387
- pos = tokenStart + 1;
13388
- end = endOfBody;
13389
- scanRegularExpressionWorker(
13390
- regExpFlags,
13391
- isUnterminated,
13392
- /*annexB*/
13393
- true
13394
- );
13395
- tokenStart = saveTokenStart;
13396
- tokenFlags = saveTokenFlags;
13397
- pos = savePos;
13398
- end = saveEnd;
13399
13420
  }
13400
13421
  tokenValue = text.substring(tokenStart, pos);
13401
13422
  token = 14 /* RegularExpressionLiteral */;
13402
13423
  }
13403
13424
  return token;
13404
13425
  }
13405
- function scanRegularExpressionWorker(regExpFlags, isUnterminated, annexB) {
13426
+ function scanRegularExpressionWorker(regExpFlags, annexB) {
13406
13427
  var unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */);
13407
- var unicodeMode = !!(regExpFlags & 96 /* UnicodeMode */);
13408
- if (unicodeMode) {
13428
+ var anyUnicodeMode = !!(regExpFlags & 96 /* AnyUnicodeMode */);
13429
+ if (anyUnicodeMode) {
13409
13430
  annexB = false;
13410
13431
  }
13411
13432
  var mayContainStrings = false;
@@ -13524,7 +13545,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13524
13545
  if (max || charCodeChecked(pos) === 125 /* closeBrace */) {
13525
13546
  error2(Diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0);
13526
13547
  } else {
13527
- if (unicodeMode) {
13548
+ if (anyUnicodeMode) {
13528
13549
  error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
13529
13550
  }
13530
13551
  isPreviousTermQuantifiable = true;
@@ -13535,7 +13556,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13535
13556
  error2(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart);
13536
13557
  }
13537
13558
  } else if (!min2) {
13538
- if (unicodeMode) {
13559
+ if (anyUnicodeMode) {
13539
13560
  error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
13540
13561
  }
13541
13562
  isPreviousTermQuantifiable = true;
@@ -13575,10 +13596,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13575
13596
  }
13576
13597
  case 93 /* closeBracket */:
13577
13598
  case 125 /* closeBrace */:
13578
- if (isUnterminated && !isInGroup) {
13579
- return;
13580
- }
13581
- if (unicodeMode || ch === 41 /* closeParen */) {
13599
+ if (anyUnicodeMode || ch === 41 /* closeParen */) {
13582
13600
  error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
13583
13601
  }
13584
13602
  pos++;
@@ -13627,7 +13645,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13627
13645
  true
13628
13646
  );
13629
13647
  scanExpectedChar(62 /* greaterThan */);
13630
- } else if (unicodeMode) {
13648
+ } else if (anyUnicodeMode) {
13631
13649
  error2(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2);
13632
13650
  }
13633
13651
  break;
@@ -13660,6 +13678,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13660
13678
  Debug.assertEqual(charCodeUnchecked(pos - 1), 92 /* backslash */);
13661
13679
  let ch = charCodeChecked(pos);
13662
13680
  switch (ch) {
13681
+ case -1 /* EOF */:
13682
+ error2(Diagnostics.Undetermined_character_escape, pos - 1, 1);
13683
+ return "\\";
13663
13684
  case 99 /* c */:
13664
13685
  pos++;
13665
13686
  ch = charCodeChecked(pos);
@@ -13667,7 +13688,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13667
13688
  pos++;
13668
13689
  return String.fromCharCode(ch & 31);
13669
13690
  }
13670
- if (unicodeMode) {
13691
+ if (anyUnicodeMode) {
13671
13692
  error2(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2);
13672
13693
  } else if (atomEscape && annexB) {
13673
13694
  pos--;
@@ -13692,14 +13713,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13692
13713
  pos++;
13693
13714
  return String.fromCharCode(ch);
13694
13715
  default:
13695
- if (pos >= end) {
13696
- error2(Diagnostics.Undetermined_character_escape, pos - 1, 1);
13697
- return "\\";
13698
- }
13699
13716
  pos--;
13700
13717
  return scanEscapeSequence(
13701
13718
  /*shouldEmitInvalidEscapeError*/
13702
- unicodeMode,
13719
+ anyUnicodeMode,
13703
13720
  /*isRegularExpression*/
13704
13721
  annexB ? "annex-b" : true
13705
13722
  );
@@ -14175,10 +14192,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
14175
14192
  }
14176
14193
  }
14177
14194
  scanExpectedChar(125 /* closeBrace */);
14178
- if (!unicodeMode) {
14195
+ if (!anyUnicodeMode) {
14179
14196
  error2(Diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start2, pos - start2);
14180
14197
  }
14181
- } else if (unicodeMode) {
14198
+ } else if (anyUnicodeMode) {
14182
14199
  error2(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch));
14183
14200
  }
14184
14201
  return true;
@@ -14198,7 +14215,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
14198
14215
  return value;
14199
14216
  }
14200
14217
  function scanSourceCharacter() {
14201
- const size = unicodeMode ? charSize(charCodeChecked(pos)) : 1;
14218
+ const size = anyUnicodeMode ? charSize(charCodeChecked(pos)) : 1;
14202
14219
  pos += size;
14203
14220
  return size > 0 ? text.substring(pos - size, pos) : "";
14204
14221
  }
@@ -32861,10 +32878,7 @@ var Parser;
32861
32878
  function parseErrorAtPosition(start, length2, message, ...args) {
32862
32879
  const lastError = lastOrUndefined(parseDiagnostics);
32863
32880
  let result;
32864
- if (message.category === 3 /* Message */ && lastError && start === lastError.start && length2 === lastError.length) {
32865
- result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
32866
- addRelatedInfo(lastError, result);
32867
- } else if (!lastError || start !== lastError.start) {
32881
+ if (!lastError || start !== lastError.start) {
32868
32882
  result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
32869
32883
  parseDiagnostics.push(result);
32870
32884
  }
@@ -70528,17 +70542,12 @@ function createTypeChecker(host) {
70528
70542
  }
70529
70543
  }
70530
70544
  function applyToReturnTypes(source, target, callback) {
70545
+ const sourceTypePredicate = getTypePredicateOfSignature(source);
70531
70546
  const targetTypePredicate = getTypePredicateOfSignature(target);
70532
- if (targetTypePredicate) {
70533
- const sourceTypePredicate = getTypePredicateOfSignature(source);
70534
- if (sourceTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) {
70535
- callback(sourceTypePredicate.type, targetTypePredicate.type);
70536
- return;
70537
- }
70538
- }
70539
- const targetReturnType = getReturnTypeOfSignature(target);
70540
- if (couldContainTypeVariables(targetReturnType)) {
70541
- callback(getReturnTypeOfSignature(source), targetReturnType);
70547
+ if (sourceTypePredicate && targetTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) {
70548
+ callback(sourceTypePredicate.type, targetTypePredicate.type);
70549
+ } else {
70550
+ callback(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target));
70542
70551
  }
70543
70552
  }
70544
70553
  function createInferenceContext(typeParameters, signature, flags, compareTypes) {
@@ -167606,7 +167615,7 @@ function entryToDocumentSpan(entry) {
167606
167615
  }
167607
167616
  }
167608
167617
  function getPrefixAndSuffixText(entry, originalNode, checker, quotePreference) {
167609
- if (entry.kind !== 0 /* Span */ && isIdentifier(originalNode)) {
167618
+ if (entry.kind !== 0 /* Span */ && (isIdentifier(originalNode) || isStringLiteralLike(originalNode))) {
167610
167619
  const { node, kind } = entry;
167611
167620
  const parent2 = node.parent;
167612
167621
  const name = originalNode.text;
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": "5.5.0-pr-58650-7",
5
+ "version": "5.5.0-pr-57201-2",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [