@typescript-deploys/pr-build 5.7.0-pr-59759-2 → 5.7.0-pr-59736-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 +5 -96
- package/lib/typescript.js +15 -103
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.7";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240827`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -1203,73 +1203,6 @@ function skipWhile(array, predicate) {
|
|
|
1203
1203
|
function isNodeLikeSystem() {
|
|
1204
1204
|
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof require !== "undefined";
|
|
1205
1205
|
}
|
|
1206
|
-
function createPrefixSuffixTrie() {
|
|
1207
|
-
function createTrie() {
|
|
1208
|
-
return {
|
|
1209
|
-
children: void 0,
|
|
1210
|
-
value: void 0
|
|
1211
|
-
};
|
|
1212
|
-
}
|
|
1213
|
-
const root = createTrie();
|
|
1214
|
-
function* iterateAllMatches(input) {
|
|
1215
|
-
var _a;
|
|
1216
|
-
let node = root;
|
|
1217
|
-
if (node.value) {
|
|
1218
|
-
yield* iterateSuffix(node.value, 0);
|
|
1219
|
-
}
|
|
1220
|
-
for (let i = 0; i < input.length; i++) {
|
|
1221
|
-
const child = (_a = node.children) == null ? void 0 : _a[input[i]];
|
|
1222
|
-
if (!child) break;
|
|
1223
|
-
if (child.value) {
|
|
1224
|
-
yield* iterateSuffix(child.value, i + 1);
|
|
1225
|
-
}
|
|
1226
|
-
node = child;
|
|
1227
|
-
}
|
|
1228
|
-
return;
|
|
1229
|
-
function* iterateSuffix(node2, start) {
|
|
1230
|
-
var _a2;
|
|
1231
|
-
if (node2.value) {
|
|
1232
|
-
yield node2.value;
|
|
1233
|
-
}
|
|
1234
|
-
for (let i = input.length - 1; i >= start; i--) {
|
|
1235
|
-
const child = (_a2 = node2.children) == null ? void 0 : _a2[input[i]];
|
|
1236
|
-
if (!child) break;
|
|
1237
|
-
if (child.value) {
|
|
1238
|
-
yield child.value;
|
|
1239
|
-
}
|
|
1240
|
-
node2 = child;
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
function set(prefix, suffix, fn) {
|
|
1245
|
-
let prefixNode = root;
|
|
1246
|
-
for (let i = 0; i < prefix.length; i++) {
|
|
1247
|
-
const char = prefix[i];
|
|
1248
|
-
const children = prefixNode.children ?? (prefixNode.children = {});
|
|
1249
|
-
const child = children[char] ?? (children[char] = createTrie());
|
|
1250
|
-
prefixNode = child;
|
|
1251
|
-
}
|
|
1252
|
-
let suffixNode = prefixNode.value ?? (prefixNode.value = createTrie());
|
|
1253
|
-
for (let i = suffix.length - 1; i >= 0; i--) {
|
|
1254
|
-
const char = suffix[i];
|
|
1255
|
-
const children = suffixNode.children ?? (suffixNode.children = {});
|
|
1256
|
-
const child = children[char] ?? (children[char] = createTrie());
|
|
1257
|
-
suffixNode = child;
|
|
1258
|
-
}
|
|
1259
|
-
suffixNode.value = fn(suffixNode.value);
|
|
1260
|
-
}
|
|
1261
|
-
function hasAnyMatch(input) {
|
|
1262
|
-
for (const _ of iterateAllMatches(input)) {
|
|
1263
|
-
return true;
|
|
1264
|
-
}
|
|
1265
|
-
return false;
|
|
1266
|
-
}
|
|
1267
|
-
return {
|
|
1268
|
-
iterateAllMatches,
|
|
1269
|
-
set,
|
|
1270
|
-
hasAnyMatch
|
|
1271
|
-
};
|
|
1272
|
-
}
|
|
1273
1206
|
|
|
1274
1207
|
// src/compiler/debug.ts
|
|
1275
1208
|
var Debug;
|
|
@@ -59988,38 +59921,13 @@ function createTypeChecker(host) {
|
|
|
59988
59921
|
}
|
|
59989
59922
|
}
|
|
59990
59923
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
59991
|
-
|
|
59992
|
-
|
|
59993
|
-
const estimatedCount = templateLiterals.length * countWhere(types, (t) => !!(t.flags & 128 /* StringLiteral */));
|
|
59994
|
-
if (estimatedCount > 0) {
|
|
59995
|
-
const trie = createPrefixSuffixTrie();
|
|
59996
|
-
forEach(templateLiterals, (t) => {
|
|
59997
|
-
const prefix = t.texts[0];
|
|
59998
|
-
const suffix = t.texts[t.texts.length - 1];
|
|
59999
|
-
trie.set(prefix, suffix, (templates) => append(templates, t));
|
|
60000
|
-
});
|
|
60001
|
-
let i = types.length;
|
|
60002
|
-
outer: while (i > 0) {
|
|
60003
|
-
i--;
|
|
60004
|
-
const t = types[i];
|
|
60005
|
-
if (!(t.flags & 128 /* StringLiteral */)) continue;
|
|
60006
|
-
const text = t.value;
|
|
60007
|
-
for (const templates of trie.iterateAllMatches(text)) {
|
|
60008
|
-
if (some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
60009
|
-
orderedRemoveItemAt(types, i);
|
|
60010
|
-
continue outer;
|
|
60011
|
-
}
|
|
60012
|
-
}
|
|
60013
|
-
}
|
|
60014
|
-
patterns = filter(patterns, (t) => !!(t.flags & 268435456 /* StringMapping */));
|
|
60015
|
-
}
|
|
60016
|
-
if (patterns.length) {
|
|
59924
|
+
const templates = filter(types, isPatternLiteralType);
|
|
59925
|
+
if (templates.length) {
|
|
60017
59926
|
let i = types.length;
|
|
60018
59927
|
while (i > 0) {
|
|
60019
59928
|
i--;
|
|
60020
59929
|
const t = types[i];
|
|
60021
|
-
if (
|
|
60022
|
-
if (some(patterns, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
59930
|
+
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
60023
59931
|
orderedRemoveItemAt(types, i);
|
|
60024
59932
|
}
|
|
60025
59933
|
}
|
|
@@ -78290,6 +78198,7 @@ function createTypeChecker(host) {
|
|
|
78290
78198
|
case 214 /* NewExpression */:
|
|
78291
78199
|
case 211 /* PropertyAccessExpression */:
|
|
78292
78200
|
case 229 /* YieldExpression */:
|
|
78201
|
+
case 110 /* ThisKeyword */:
|
|
78293
78202
|
return 3 /* Sometimes */;
|
|
78294
78203
|
case 226 /* BinaryExpression */:
|
|
78295
78204
|
switch (node.operatorToken.kind) {
|
package/lib/typescript.js
CHANGED
|
@@ -429,7 +429,6 @@ __export(typescript_exports, {
|
|
|
429
429
|
createPackageJsonInfo: () => createPackageJsonInfo,
|
|
430
430
|
createParenthesizerRules: () => createParenthesizerRules,
|
|
431
431
|
createPatternMatcher: () => createPatternMatcher,
|
|
432
|
-
createPrefixSuffixTrie: () => createPrefixSuffixTrie,
|
|
433
432
|
createPrinter: () => createPrinter,
|
|
434
433
|
createPrinterWithDefaults: () => createPrinterWithDefaults,
|
|
435
434
|
createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
|
|
@@ -2266,7 +2265,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2266
2265
|
|
|
2267
2266
|
// src/compiler/corePublic.ts
|
|
2268
2267
|
var versionMajorMinor = "5.7";
|
|
2269
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2268
|
+
var version = `${versionMajorMinor}.0-insiders.20240827`;
|
|
2270
2269
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2271
2270
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2272
2271
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3746,73 +3745,6 @@ function skipWhile(array, predicate) {
|
|
|
3746
3745
|
function isNodeLikeSystem() {
|
|
3747
3746
|
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof require !== "undefined";
|
|
3748
3747
|
}
|
|
3749
|
-
function createPrefixSuffixTrie() {
|
|
3750
|
-
function createTrie() {
|
|
3751
|
-
return {
|
|
3752
|
-
children: void 0,
|
|
3753
|
-
value: void 0
|
|
3754
|
-
};
|
|
3755
|
-
}
|
|
3756
|
-
const root = createTrie();
|
|
3757
|
-
function* iterateAllMatches(input) {
|
|
3758
|
-
var _a;
|
|
3759
|
-
let node = root;
|
|
3760
|
-
if (node.value) {
|
|
3761
|
-
yield* iterateSuffix(node.value, 0);
|
|
3762
|
-
}
|
|
3763
|
-
for (let i = 0; i < input.length; i++) {
|
|
3764
|
-
const child = (_a = node.children) == null ? void 0 : _a[input[i]];
|
|
3765
|
-
if (!child) break;
|
|
3766
|
-
if (child.value) {
|
|
3767
|
-
yield* iterateSuffix(child.value, i + 1);
|
|
3768
|
-
}
|
|
3769
|
-
node = child;
|
|
3770
|
-
}
|
|
3771
|
-
return;
|
|
3772
|
-
function* iterateSuffix(node2, start) {
|
|
3773
|
-
var _a2;
|
|
3774
|
-
if (node2.value) {
|
|
3775
|
-
yield node2.value;
|
|
3776
|
-
}
|
|
3777
|
-
for (let i = input.length - 1; i >= start; i--) {
|
|
3778
|
-
const child = (_a2 = node2.children) == null ? void 0 : _a2[input[i]];
|
|
3779
|
-
if (!child) break;
|
|
3780
|
-
if (child.value) {
|
|
3781
|
-
yield child.value;
|
|
3782
|
-
}
|
|
3783
|
-
node2 = child;
|
|
3784
|
-
}
|
|
3785
|
-
}
|
|
3786
|
-
}
|
|
3787
|
-
function set(prefix, suffix, fn) {
|
|
3788
|
-
let prefixNode = root;
|
|
3789
|
-
for (let i = 0; i < prefix.length; i++) {
|
|
3790
|
-
const char = prefix[i];
|
|
3791
|
-
const children = prefixNode.children ?? (prefixNode.children = {});
|
|
3792
|
-
const child = children[char] ?? (children[char] = createTrie());
|
|
3793
|
-
prefixNode = child;
|
|
3794
|
-
}
|
|
3795
|
-
let suffixNode = prefixNode.value ?? (prefixNode.value = createTrie());
|
|
3796
|
-
for (let i = suffix.length - 1; i >= 0; i--) {
|
|
3797
|
-
const char = suffix[i];
|
|
3798
|
-
const children = suffixNode.children ?? (suffixNode.children = {});
|
|
3799
|
-
const child = children[char] ?? (children[char] = createTrie());
|
|
3800
|
-
suffixNode = child;
|
|
3801
|
-
}
|
|
3802
|
-
suffixNode.value = fn(suffixNode.value);
|
|
3803
|
-
}
|
|
3804
|
-
function hasAnyMatch(input) {
|
|
3805
|
-
for (const _ of iterateAllMatches(input)) {
|
|
3806
|
-
return true;
|
|
3807
|
-
}
|
|
3808
|
-
return false;
|
|
3809
|
-
}
|
|
3810
|
-
return {
|
|
3811
|
-
iterateAllMatches,
|
|
3812
|
-
set,
|
|
3813
|
-
hasAnyMatch
|
|
3814
|
-
};
|
|
3815
|
-
}
|
|
3816
3748
|
|
|
3817
3749
|
// src/compiler/debug.ts
|
|
3818
3750
|
var LogLevel = /* @__PURE__ */ ((LogLevel3) => {
|
|
@@ -64611,38 +64543,13 @@ function createTypeChecker(host) {
|
|
|
64611
64543
|
}
|
|
64612
64544
|
}
|
|
64613
64545
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
64614
|
-
|
|
64615
|
-
|
|
64616
|
-
const estimatedCount = templateLiterals.length * countWhere(types, (t) => !!(t.flags & 128 /* StringLiteral */));
|
|
64617
|
-
if (estimatedCount > 0) {
|
|
64618
|
-
const trie = createPrefixSuffixTrie();
|
|
64619
|
-
forEach(templateLiterals, (t) => {
|
|
64620
|
-
const prefix = t.texts[0];
|
|
64621
|
-
const suffix = t.texts[t.texts.length - 1];
|
|
64622
|
-
trie.set(prefix, suffix, (templates) => append(templates, t));
|
|
64623
|
-
});
|
|
64624
|
-
let i = types.length;
|
|
64625
|
-
outer: while (i > 0) {
|
|
64626
|
-
i--;
|
|
64627
|
-
const t = types[i];
|
|
64628
|
-
if (!(t.flags & 128 /* StringLiteral */)) continue;
|
|
64629
|
-
const text = t.value;
|
|
64630
|
-
for (const templates of trie.iterateAllMatches(text)) {
|
|
64631
|
-
if (some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
64632
|
-
orderedRemoveItemAt(types, i);
|
|
64633
|
-
continue outer;
|
|
64634
|
-
}
|
|
64635
|
-
}
|
|
64636
|
-
}
|
|
64637
|
-
patterns = filter(patterns, (t) => !!(t.flags & 268435456 /* StringMapping */));
|
|
64638
|
-
}
|
|
64639
|
-
if (patterns.length) {
|
|
64546
|
+
const templates = filter(types, isPatternLiteralType);
|
|
64547
|
+
if (templates.length) {
|
|
64640
64548
|
let i = types.length;
|
|
64641
64549
|
while (i > 0) {
|
|
64642
64550
|
i--;
|
|
64643
64551
|
const t = types[i];
|
|
64644
|
-
if (
|
|
64645
|
-
if (some(patterns, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
64552
|
+
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
64646
64553
|
orderedRemoveItemAt(types, i);
|
|
64647
64554
|
}
|
|
64648
64555
|
}
|
|
@@ -82913,6 +82820,7 @@ function createTypeChecker(host) {
|
|
|
82913
82820
|
case 214 /* NewExpression */:
|
|
82914
82821
|
case 211 /* PropertyAccessExpression */:
|
|
82915
82822
|
case 229 /* YieldExpression */:
|
|
82823
|
+
case 110 /* ThisKeyword */:
|
|
82916
82824
|
return 3 /* Sometimes */;
|
|
82917
82825
|
case 226 /* BinaryExpression */:
|
|
82918
82826
|
switch (node.operatorToken.kind) {
|
|
@@ -164832,9 +164740,13 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
164832
164740
|
if (parentNamedImportOrExport) {
|
|
164833
164741
|
const languageVersion = getEmitScriptTarget(host.getCompilationSettings());
|
|
164834
164742
|
if (!isIdentifierText(name, languageVersion)) {
|
|
164835
|
-
insertText =
|
|
164743
|
+
insertText = quotePropertyName(sourceFile, preferences, name);
|
|
164836
164744
|
if (parentNamedImportOrExport.kind === 275 /* NamedImports */) {
|
|
164837
|
-
|
|
164745
|
+
scanner.setText(sourceFile.text);
|
|
164746
|
+
scanner.resetTokenState(position);
|
|
164747
|
+
if (!(scanner.scan() === 130 /* AsKeyword */ && scanner.scan() === 80 /* Identifier */)) {
|
|
164748
|
+
insertText += " as " + generateIdentifierForArbitraryString(name, languageVersion);
|
|
164749
|
+
}
|
|
164838
164750
|
}
|
|
164839
164751
|
} else if (parentNamedImportOrExport.kind === 275 /* NamedImports */) {
|
|
164840
164752
|
const possibleToken = stringToToken(name);
|
|
@@ -167002,7 +166914,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
167002
166914
|
case 153 /* SetKeyword */:
|
|
167003
166915
|
return !isFromObjectTypeDeclaration(contextToken2);
|
|
167004
166916
|
case 80 /* Identifier */: {
|
|
167005
|
-
if (containingNodeKind === 276 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") {
|
|
166917
|
+
if ((containingNodeKind === 276 /* ImportSpecifier */ || containingNodeKind === 281 /* ExportSpecifier */) && contextToken2 === parent2.name && contextToken2.text === "type") {
|
|
167006
166918
|
return false;
|
|
167007
166919
|
}
|
|
167008
166920
|
const ancestorVariableDeclaration = findAncestor(
|
|
@@ -178791,6 +178703,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
|
|
|
178791
178703
|
Debug.assert(rangeContainsRange(parent2, currentTokenInfo.token));
|
|
178792
178704
|
const lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine();
|
|
178793
178705
|
let indentToken = false;
|
|
178706
|
+
let isNewlineSemicolon = false;
|
|
178794
178707
|
if (currentTokenInfo.leadingTrivia) {
|
|
178795
178708
|
processTrivia(currentTokenInfo.leadingTrivia, parent2, childContextNode, dynamicIndentation);
|
|
178796
178709
|
}
|
|
@@ -178805,6 +178718,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
|
|
|
178805
178718
|
if (lineAction === 0 /* None */) {
|
|
178806
178719
|
const prevEndLine = savePreviousRange && sourceFile.getLineAndCharacterOfPosition(savePreviousRange.end).line;
|
|
178807
178720
|
indentToken = lastTriviaWasNewLine && tokenStart.line !== prevEndLine;
|
|
178721
|
+
isNewlineSemicolon = currentTokenInfo.token.kind === 27 /* SemicolonToken */;
|
|
178808
178722
|
} else {
|
|
178809
178723
|
indentToken = lineAction === 1 /* LineAdded */;
|
|
178810
178724
|
}
|
|
@@ -178815,7 +178729,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
|
|
|
178815
178729
|
processTrivia(currentTokenInfo.trailingTrivia, parent2, childContextNode, dynamicIndentation);
|
|
178816
178730
|
}
|
|
178817
178731
|
if (indentToken) {
|
|
178818
|
-
const tokenIndentation = isTokenInRange && !rangeContainsError(currentTokenInfo.token) ? dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container, !!isListEndToken) : -1 /* Unknown */;
|
|
178732
|
+
const tokenIndentation = isTokenInRange && !rangeContainsError(currentTokenInfo.token) ? dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container, !!isListEndToken || isNewlineSemicolon) : -1 /* Unknown */;
|
|
178819
178733
|
let indentNextTokenOrTrivia = true;
|
|
178820
178734
|
if (currentTokenInfo.leadingTrivia) {
|
|
178821
178735
|
const commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation, container);
|
|
@@ -180243,7 +180157,6 @@ __export(ts_exports2, {
|
|
|
180243
180157
|
createPackageJsonInfo: () => createPackageJsonInfo,
|
|
180244
180158
|
createParenthesizerRules: () => createParenthesizerRules,
|
|
180245
180159
|
createPatternMatcher: () => createPatternMatcher,
|
|
180246
|
-
createPrefixSuffixTrie: () => createPrefixSuffixTrie,
|
|
180247
180160
|
createPrinter: () => createPrinter,
|
|
180248
180161
|
createPrinterWithDefaults: () => createPrinterWithDefaults,
|
|
180249
180162
|
createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
|
|
@@ -194602,7 +194515,6 @@ if (typeof console !== "undefined") {
|
|
|
194602
194515
|
createPackageJsonInfo,
|
|
194603
194516
|
createParenthesizerRules,
|
|
194604
194517
|
createPatternMatcher,
|
|
194605
|
-
createPrefixSuffixTrie,
|
|
194606
194518
|
createPrinter,
|
|
194607
194519
|
createPrinterWithDefaults,
|
|
194608
194520
|
createPrinterWithRemoveComments,
|
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.7.0-pr-
|
|
5
|
+
"version": "5.7.0-pr-59736-2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|