@typescript-deploys/pr-build 4.9.0-pr-50528-10 → 4.9.0-pr-50620-15
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/README.md +0 -53
- package/lib/tsc.js +163 -159
- package/lib/tsserver.js +176 -190
- package/lib/tsserverlibrary.d.ts +0 -1
- package/lib/tsserverlibrary.js +175 -175
- package/lib/typescript.js +168 -168
- package/lib/typescriptServices.js +168 -168
- package/lib/typingsInstaller.js +167 -167
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -46,59 +46,6 @@ with any additional questions or comments.
|
|
|
46
46
|
* [Programming handbook](https://www.typescriptlang.org/docs/handbook/intro.html)
|
|
47
47
|
* [Homepage](https://www.typescriptlang.org/)
|
|
48
48
|
|
|
49
|
-
## Building
|
|
50
|
-
|
|
51
|
-
In order to build the TypeScript compiler, ensure that you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed.
|
|
52
|
-
|
|
53
|
-
Clone a copy of the repo:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
git clone https://github.com/microsoft/TypeScript.git
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Change to the TypeScript directory:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
cd TypeScript
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Install [Gulp](https://gulpjs.com/) tools and dev dependencies:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
npm install -g gulp
|
|
69
|
-
npm ci
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Use one of the following to build and test:
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
gulp local # Build the compiler into built/local.
|
|
76
|
-
gulp clean # Delete the built compiler.
|
|
77
|
-
gulp LKG # Replace the last known good with the built one.
|
|
78
|
-
# Bootstrapping step to be executed when the built compiler reaches a stable state.
|
|
79
|
-
gulp tests # Build the test infrastructure using the built compiler.
|
|
80
|
-
gulp runtests # Run tests using the built compiler and test infrastructure.
|
|
81
|
-
# You can override the specific suite runner used or specify a test for this command.
|
|
82
|
-
# Use --tests=<testPath> for a specific test and/or --runner=<runnerName> for a specific suite.
|
|
83
|
-
# Valid runners include conformance, compiler, fourslash, project, user, and docker
|
|
84
|
-
# The user and docker runners are extended test suite runners - the user runner
|
|
85
|
-
# works on disk in the tests/cases/user directory, while the docker runner works in containers.
|
|
86
|
-
# You'll need to have the docker executable in your system path for the docker runner to work.
|
|
87
|
-
gulp runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
|
|
88
|
-
# core count by default. Use --workers=<number> to adjust this.
|
|
89
|
-
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
|
|
90
|
-
gulp lint # Runs eslint on the TypeScript source.
|
|
91
|
-
gulp help # List the above commands.
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## Usage
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
node built/local/tsc.js hello.ts
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
|
|
102
49
|
## Roadmap
|
|
103
50
|
|
|
104
51
|
For details on our planned features and future direction please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap).
|
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.9";
|
|
72
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.
|
|
72
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20220907");
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -3733,7 +3733,6 @@ var ts;
|
|
|
3733
3733
|
createPollingIntervalBasedLevels(customLevels ? __assign(__assign({}, defaultLevels), customLevels) : defaultLevels);
|
|
3734
3734
|
}
|
|
3735
3735
|
}
|
|
3736
|
-
ts.setCustomPollingValues = setCustomPollingValues;
|
|
3737
3736
|
function pollWatchedFileQueue(host, queue, pollIndex, chunkSize, callbackOnWatchFileStat) {
|
|
3738
3737
|
var definedValueCopyToIndex = pollIndex;
|
|
3739
3738
|
for (var canVisit = queue.length; chunkSize && canVisit; nextPollIndex(), canVisit--) {
|
|
@@ -3871,7 +3870,6 @@ var ts;
|
|
|
3871
3870
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval));
|
|
3872
3871
|
}
|
|
3873
3872
|
}
|
|
3874
|
-
ts.createDynamicPriorityPollingWatchFile = createDynamicPriorityPollingWatchFile;
|
|
3875
3873
|
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
|
|
3876
3874
|
var fileWatcherCallbacks = ts.createMultiMap();
|
|
3877
3875
|
var dirWatchers = new ts.Map();
|
|
@@ -3946,37 +3944,31 @@ var ts;
|
|
|
3946
3944
|
pollScheduled = host.setTimeout(pollQueue, PollingInterval.High);
|
|
3947
3945
|
}
|
|
3948
3946
|
}
|
|
3949
|
-
function
|
|
3950
|
-
var cache = new ts.Map();
|
|
3951
|
-
var callbacksCache = ts.createMultiMap();
|
|
3947
|
+
function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) {
|
|
3952
3948
|
var toCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
cache.
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3949
|
+
var path = toCanonicalFileName(name);
|
|
3950
|
+
var existing = cache.get(path);
|
|
3951
|
+
if (existing) {
|
|
3952
|
+
existing.callbacks.push(callback);
|
|
3953
|
+
}
|
|
3954
|
+
else {
|
|
3955
|
+
cache.set(path, {
|
|
3956
|
+
watcher: createWatcher((function (param1, param2, param3) { var _a; return (_a = cache.get(path)) === null || _a === void 0 ? void 0 : _a.callbacks.slice().forEach(function (cb) { return cb(param1, param2, param3); }); })),
|
|
3957
|
+
callbacks: [callback]
|
|
3958
|
+
});
|
|
3959
|
+
}
|
|
3960
|
+
return {
|
|
3961
|
+
close: function () {
|
|
3962
|
+
var watcher = cache.get(path);
|
|
3963
|
+
if (!watcher)
|
|
3964
|
+
return;
|
|
3965
|
+
if (!ts.orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length)
|
|
3966
|
+
return;
|
|
3967
|
+
cache.delete(path);
|
|
3968
|
+
ts.closeFileWatcherOf(watcher);
|
|
3964
3969
|
}
|
|
3965
|
-
callbacksCache.add(path, callback);
|
|
3966
|
-
return {
|
|
3967
|
-
close: function () {
|
|
3968
|
-
var watcher = ts.Debug.checkDefined(cache.get(path));
|
|
3969
|
-
callbacksCache.remove(path, callback);
|
|
3970
|
-
watcher.refCount--;
|
|
3971
|
-
if (watcher.refCount)
|
|
3972
|
-
return;
|
|
3973
|
-
cache.delete(path);
|
|
3974
|
-
ts.closeFileWatcherOf(watcher);
|
|
3975
|
-
}
|
|
3976
|
-
};
|
|
3977
3970
|
};
|
|
3978
3971
|
}
|
|
3979
|
-
ts.createSingleFileWatcherPerName = createSingleFileWatcherPerName;
|
|
3980
3972
|
function onWatchedFileStat(watchedFile, modifiedTime) {
|
|
3981
3973
|
var oldTime = watchedFile.mtime.getTime();
|
|
3982
3974
|
var newTime = modifiedTime.getTime();
|
|
@@ -3987,7 +3979,6 @@ var ts;
|
|
|
3987
3979
|
}
|
|
3988
3980
|
return false;
|
|
3989
3981
|
}
|
|
3990
|
-
ts.onWatchedFileStat = onWatchedFileStat;
|
|
3991
3982
|
function getFileWatcherEventKind(oldTime, newTime) {
|
|
3992
3983
|
return oldTime === 0
|
|
3993
3984
|
? FileWatcherEventKind.Created
|
|
@@ -4194,11 +4185,9 @@ var ts;
|
|
|
4194
4185
|
return ts.stringContains(toCanonicalFilePath(path), searchPath);
|
|
4195
4186
|
}
|
|
4196
4187
|
}
|
|
4197
|
-
ts.createDirectoryWatcherSupportingRecursive = createDirectoryWatcherSupportingRecursive;
|
|
4198
4188
|
function createFileWatcherCallback(callback) {
|
|
4199
4189
|
return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
|
|
4200
4190
|
}
|
|
4201
|
-
ts.createFileWatcherCallback = createFileWatcherCallback;
|
|
4202
4191
|
function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
|
|
4203
4192
|
return function (eventName, _relativeFileName, modifiedTime) {
|
|
4204
4193
|
if (eventName === "rename") {
|
|
@@ -4225,7 +4214,10 @@ var ts;
|
|
|
4225
4214
|
};
|
|
4226
4215
|
}
|
|
4227
4216
|
function createSystemWatchFunctions(_a) {
|
|
4228
|
-
var
|
|
4217
|
+
var pollingWatchFileWorker = _a.pollingWatchFileWorker, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatchWorker = _a.fsWatchWorker, fileSystemEntryExists = _a.fileSystemEntryExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind, inodeWatching = _a.inodeWatching, sysLog = _a.sysLog;
|
|
4218
|
+
var pollingWatches = new ts.Map();
|
|
4219
|
+
var fsWatches = new ts.Map();
|
|
4220
|
+
var fsWatchesRecursive = new ts.Map();
|
|
4229
4221
|
var dynamicPollingWatchFile;
|
|
4230
4222
|
var fixedChunkSizePollingWatchFile;
|
|
4231
4223
|
var nonPollingWatchFile;
|
|
@@ -4281,7 +4273,7 @@ var ts;
|
|
|
4281
4273
|
default:
|
|
4282
4274
|
return useNonPollingWatchers ?
|
|
4283
4275
|
generateWatchFileOptions(ts.WatchFileKind.UseFsEventsOnParentDirectory, ts.PollingWatchKind.PriorityInterval, options) :
|
|
4284
|
-
{ watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.
|
|
4276
|
+
{ watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.UseFsEvents };
|
|
4285
4277
|
}
|
|
4286
4278
|
}
|
|
4287
4279
|
function generateWatchFileOptions(watchFile, fallbackPolling, options) {
|
|
@@ -4346,7 +4338,13 @@ var ts;
|
|
|
4346
4338
|
};
|
|
4347
4339
|
}
|
|
4348
4340
|
}
|
|
4341
|
+
function pollingWatchFile(fileName, callback, pollingInterval, options) {
|
|
4342
|
+
return createSingleWatcherPerName(pollingWatches, useCaseSensitiveFileNames, fileName, callback, function (cb) { return pollingWatchFileWorker(fileName, cb, pollingInterval, options); });
|
|
4343
|
+
}
|
|
4349
4344
|
function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
4345
|
+
return createSingleWatcherPerName(recursive ? fsWatchesRecursive : fsWatches, useCaseSensitiveFileNames, fileOrDirectory, callback, function (cb) { return fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions); });
|
|
4346
|
+
}
|
|
4347
|
+
function fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
4350
4348
|
var lastDirectoryPartWithDirectorySeparator;
|
|
4351
4349
|
var lastDirectoryPart;
|
|
4352
4350
|
if (inodeWatching) {
|
|
@@ -4484,7 +4482,7 @@ var ts;
|
|
|
4484
4482
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
4485
4483
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
4486
4484
|
var _b = createSystemWatchFunctions({
|
|
4487
|
-
|
|
4485
|
+
pollingWatchFileWorker: fsWatchFileWorker,
|
|
4488
4486
|
getModifiedTime: getModifiedTime,
|
|
4489
4487
|
setTimeout: setTimeout,
|
|
4490
4488
|
clearTimeout: clearTimeout,
|
|
@@ -36780,7 +36778,7 @@ var ts;
|
|
|
36780
36778
|
var _a, _b;
|
|
36781
36779
|
if (path === undefined)
|
|
36782
36780
|
return path;
|
|
36783
|
-
return ts.
|
|
36781
|
+
return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
36784
36782
|
}
|
|
36785
36783
|
function combineDirectoryPath(root, dir) {
|
|
36786
36784
|
return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
|
|
@@ -36795,7 +36793,7 @@ var ts;
|
|
|
36795
36793
|
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
|
|
36796
36794
|
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
|
|
36797
36795
|
&& finalPath.indexOf("/node_modules/") === -1
|
|
36798
|
-
&& (state.compilerOptions.configFile ? ts.
|
|
36796
|
+
&& (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
36799
36797
|
var getCanonicalFileName = ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames });
|
|
36800
36798
|
var commonSourceDirGuesses = [];
|
|
36801
36799
|
if (state.compilerOptions.rootDir || (state.compilerOptions.composite && state.compilerOptions.configFilePath)) {
|
|
@@ -36825,7 +36823,7 @@ var ts;
|
|
|
36825
36823
|
var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
36826
36824
|
for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
|
|
36827
36825
|
var candidateDir = candidateDirectories_1[_e];
|
|
36828
|
-
if (ts.
|
|
36826
|
+
if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
36829
36827
|
var pathFragment = finalPath.slice(candidateDir.length + 1);
|
|
36830
36828
|
var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
|
|
36831
36829
|
var jsAndDtsExtensions = [".mjs", ".cjs", ".js", ".json", ".d.mts", ".d.cts", ".d.ts"];
|
|
@@ -44844,7 +44842,7 @@ var ts;
|
|
|
44844
44842
|
}
|
|
44845
44843
|
var visited = ts.visitEachChild(node, elideInitializerAndPropertyRenamingAndSetEmitFlags, ts.nullTransformationContext, undefined, elideInitializerAndPropertyRenamingAndSetEmitFlags);
|
|
44846
44844
|
if (ts.isBindingElement(visited)) {
|
|
44847
|
-
if (visited.propertyName && ts.isIdentifier(visited.propertyName) && ts.isIdentifier(visited.name)) {
|
|
44845
|
+
if (visited.propertyName && ts.isIdentifier(visited.propertyName) && ts.isIdentifier(visited.name) && !ts.isStringAKeyword(ts.idText(visited.propertyName))) {
|
|
44848
44846
|
visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken, undefined, visited.propertyName, undefined);
|
|
44849
44847
|
}
|
|
44850
44848
|
else {
|
|
@@ -48293,7 +48291,6 @@ var ts;
|
|
|
48293
48291
|
return false;
|
|
48294
48292
|
}
|
|
48295
48293
|
function isLiteralEnumMember(member) {
|
|
48296
|
-
var _a, _b;
|
|
48297
48294
|
var expr = member.initializer;
|
|
48298
48295
|
if (!expr) {
|
|
48299
48296
|
return !(member.flags & 16777216);
|
|
@@ -48307,7 +48304,7 @@ var ts;
|
|
|
48307
48304
|
return expr.operator === 40 &&
|
|
48308
48305
|
expr.operand.kind === 8;
|
|
48309
48306
|
case 79:
|
|
48310
|
-
return ts.nodeIsMissing(expr) ||
|
|
48307
|
+
return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);
|
|
48311
48308
|
case 222:
|
|
48312
48309
|
return isStringConcatExpression(expr);
|
|
48313
48310
|
default:
|
|
@@ -48326,7 +48323,7 @@ var ts;
|
|
|
48326
48323
|
if (declaration.kind === 262) {
|
|
48327
48324
|
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
|
|
48328
48325
|
var member = _c[_b];
|
|
48329
|
-
if (member.initializer &&
|
|
48326
|
+
if (member.initializer && ts.isStringLiteralLike(member.initializer)) {
|
|
48330
48327
|
return links.enumKind = 1;
|
|
48331
48328
|
}
|
|
48332
48329
|
if (!isLiteralEnumMember(member)) {
|
|
@@ -51996,7 +51993,7 @@ var ts;
|
|
|
51996
51993
|
return includes & 8388608 ? wildcardType : anyType;
|
|
51997
51994
|
}
|
|
51998
51995
|
if (!strictNullChecks && includes & 98304) {
|
|
51999
|
-
return includes & 32768 ? undefinedType : nullType;
|
|
51996
|
+
return includes & 16777216 ? neverType : includes & 32768 ? undefinedType : nullType;
|
|
52000
51997
|
}
|
|
52001
51998
|
if (includes & 4 && includes & (128 | 134217728 | 268435456) ||
|
|
52002
51999
|
includes & 8 && includes & 256 ||
|
|
@@ -52631,7 +52628,7 @@ var ts;
|
|
|
52631
52628
|
type;
|
|
52632
52629
|
}
|
|
52633
52630
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
52634
|
-
if (objectType.flags &
|
|
52631
|
+
if (objectType.flags & 1048576 || objectType.flags & 2097152 && !shouldDeferIndexType(objectType)) {
|
|
52635
52632
|
var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
|
|
52636
52633
|
return objectType.flags & 2097152 || writing ? getIntersectionType(types) : getUnionType(types);
|
|
52637
52634
|
}
|
|
@@ -54763,7 +54760,7 @@ var ts;
|
|
|
54763
54760
|
if (reduced !== type) {
|
|
54764
54761
|
return reduced;
|
|
54765
54762
|
}
|
|
54766
|
-
if (type.flags & 2097152) {
|
|
54763
|
+
if (type.flags & 2097152 && ts.some(type.types, isEmptyAnonymousObjectType)) {
|
|
54767
54764
|
var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
|
|
54768
54765
|
if (normalizedTypes !== type.types) {
|
|
54769
54766
|
return getIntersectionType(normalizedTypes);
|
|
@@ -55815,8 +55812,8 @@ var ts;
|
|
|
55815
55812
|
if (!c.root.inferTypeParameters && !isDistributionDependent(c.root)) {
|
|
55816
55813
|
var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
55817
55814
|
var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
55818
|
-
if (result = skipTrue ? -1 : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2, false)) {
|
|
55819
|
-
result &= skipFalse ? -1 : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2, false);
|
|
55815
|
+
if (result = skipTrue ? -1 : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2, false, undefined, intersectionState)) {
|
|
55816
|
+
result &= skipFalse ? -1 : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2, false, undefined, intersectionState);
|
|
55820
55817
|
if (result) {
|
|
55821
55818
|
return result;
|
|
55822
55819
|
}
|
|
@@ -60175,7 +60172,7 @@ var ts;
|
|
|
60175
60172
|
var narrowedPropType = narrowType(propType);
|
|
60176
60173
|
return filterType(type, function (t) {
|
|
60177
60174
|
var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
60178
|
-
return !(narrowedPropType.flags & 131072) &&
|
|
60175
|
+
return !(narrowedPropType.flags & 131072) && areTypesComparable(narrowedPropType, discriminantType);
|
|
60179
60176
|
});
|
|
60180
60177
|
}
|
|
60181
60178
|
function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
|
|
@@ -60224,7 +60221,7 @@ var ts;
|
|
|
60224
60221
|
}
|
|
60225
60222
|
function narrowByInKeyword(type, name, assumeTrue) {
|
|
60226
60223
|
if (type.flags & 1048576
|
|
60227
|
-
|| type.flags & 524288 && declaredType !== type
|
|
60224
|
+
|| type.flags & 524288 && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
|
|
60228
60225
|
|| ts.isThisTypeParameter(type)
|
|
60229
60226
|
|| type.flags & 2097152 && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
60230
60227
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
@@ -60344,14 +60341,18 @@ var ts;
|
|
|
60344
60341
|
assumeTrue = !assumeTrue;
|
|
60345
60342
|
}
|
|
60346
60343
|
var valueType = getTypeOfExpression(value);
|
|
60347
|
-
if ((type.flags & 2)
|
|
60344
|
+
if (((type.flags & 2) || isEmptyAnonymousObjectType(type) && !(valueType.flags & 98304)) &&
|
|
60345
|
+
assumeTrue &&
|
|
60346
|
+
(operator === 36 || operator === 37)) {
|
|
60348
60347
|
if (valueType.flags & (131068 | 67108864)) {
|
|
60349
60348
|
return valueType;
|
|
60350
60349
|
}
|
|
60351
60350
|
if (valueType.flags & 524288) {
|
|
60352
60351
|
return nonPrimitiveType;
|
|
60353
60352
|
}
|
|
60354
|
-
|
|
60353
|
+
if (type.flags & 2) {
|
|
60354
|
+
return type;
|
|
60355
|
+
}
|
|
60355
60356
|
}
|
|
60356
60357
|
if (valueType.flags & 98304) {
|
|
60357
60358
|
if (!strictNullChecks) {
|
|
@@ -60382,11 +60383,18 @@ var ts;
|
|
|
60382
60383
|
}
|
|
60383
60384
|
var target = getReferenceCandidate(typeOfExpr.expression);
|
|
60384
60385
|
if (!isMatchingReference(reference, target)) {
|
|
60386
|
+
var propertyAccess = getDiscriminantPropertyAccess(typeOfExpr.expression, type);
|
|
60387
|
+
if (propertyAccess) {
|
|
60388
|
+
return narrowTypeByDiscriminant(type, propertyAccess, function (t) { return narrowTypeByLiteralExpression(t, literal, assumeTrue); });
|
|
60389
|
+
}
|
|
60385
60390
|
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
|
60386
60391
|
return getAdjustedTypeWithFacts(type, 2097152);
|
|
60387
60392
|
}
|
|
60388
60393
|
return type;
|
|
60389
60394
|
}
|
|
60395
|
+
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
60396
|
+
}
|
|
60397
|
+
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
60390
60398
|
return assumeTrue ?
|
|
60391
60399
|
narrowTypeByTypeName(type, literal.text) :
|
|
60392
60400
|
getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768);
|
|
@@ -62694,6 +62702,7 @@ var ts;
|
|
|
62694
62702
|
}
|
|
62695
62703
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
62696
62704
|
var attributes = openingLikeElement.attributes;
|
|
62705
|
+
var attributesType = getContextualType(attributes, 0);
|
|
62697
62706
|
var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
62698
62707
|
var attributesTable = ts.createSymbolTable();
|
|
62699
62708
|
var spread = emptyJsxObjectType;
|
|
@@ -62721,6 +62730,12 @@ var ts;
|
|
|
62721
62730
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
62722
62731
|
explicitlySpecifyChildrenAttribute = true;
|
|
62723
62732
|
}
|
|
62733
|
+
if (attributesType) {
|
|
62734
|
+
var prop = getPropertyOfType(attributesType, member.escapedName);
|
|
62735
|
+
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
62736
|
+
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
62737
|
+
}
|
|
62738
|
+
}
|
|
62724
62739
|
}
|
|
62725
62740
|
else {
|
|
62726
62741
|
ts.Debug.assert(attributeDecl.kind === 289);
|
|
@@ -72200,8 +72215,8 @@ var ts;
|
|
|
72200
72215
|
var enumKind = getEnumKind(getSymbolOfNode(member.parent));
|
|
72201
72216
|
var isConstEnum = ts.isEnumConst(member.parent);
|
|
72202
72217
|
var initializer = member.initializer;
|
|
72203
|
-
var value = enumKind === 1 && !isLiteralEnumMember(member) ? undefined : evaluate(initializer
|
|
72204
|
-
if (value !== undefined
|
|
72218
|
+
var value = enumKind === 1 && !isLiteralEnumMember(member) ? undefined : evaluate(initializer);
|
|
72219
|
+
if (value !== undefined) {
|
|
72205
72220
|
if (isConstEnum && typeof value === "number" && !isFinite(value)) {
|
|
72206
72221
|
error(initializer, isNaN(value) ?
|
|
72207
72222
|
ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN :
|
|
@@ -72228,97 +72243,101 @@ var ts;
|
|
|
72228
72243
|
}
|
|
72229
72244
|
}
|
|
72230
72245
|
return value;
|
|
72231
|
-
|
|
72232
|
-
|
|
72233
|
-
|
|
72234
|
-
|
|
72235
|
-
|
|
72236
|
-
|
|
72237
|
-
|
|
72238
|
-
|
|
72239
|
-
|
|
72240
|
-
|
|
72246
|
+
function evaluate(expr) {
|
|
72247
|
+
switch (expr.kind) {
|
|
72248
|
+
case 220:
|
|
72249
|
+
var value_2 = evaluate(expr.operand);
|
|
72250
|
+
if (typeof value_2 === "number") {
|
|
72251
|
+
switch (expr.operator) {
|
|
72252
|
+
case 39: return value_2;
|
|
72253
|
+
case 40: return -value_2;
|
|
72254
|
+
case 54: return ~value_2;
|
|
72255
|
+
}
|
|
72241
72256
|
}
|
|
72242
|
-
|
|
72243
|
-
|
|
72244
|
-
|
|
72245
|
-
|
|
72246
|
-
|
|
72247
|
-
|
|
72248
|
-
|
|
72249
|
-
|
|
72250
|
-
|
|
72251
|
-
|
|
72252
|
-
|
|
72253
|
-
|
|
72254
|
-
|
|
72255
|
-
|
|
72256
|
-
|
|
72257
|
-
|
|
72258
|
-
|
|
72259
|
-
|
|
72260
|
-
case 42: return Math.pow(left, right);
|
|
72261
|
-
}
|
|
72262
|
-
}
|
|
72263
|
-
else if (typeof left === "string" && typeof right === "string" && expr.operatorToken.kind === 39) {
|
|
72264
|
-
return left + right;
|
|
72265
|
-
}
|
|
72266
|
-
break;
|
|
72267
|
-
case 10:
|
|
72268
|
-
case 14:
|
|
72269
|
-
return expr.text;
|
|
72270
|
-
case 8:
|
|
72271
|
-
checkGrammarNumericLiteral(expr);
|
|
72272
|
-
return +expr.text;
|
|
72273
|
-
case 213:
|
|
72274
|
-
return evaluate(expr.expression, location);
|
|
72275
|
-
case 79:
|
|
72276
|
-
if (ts.isInfinityOrNaNString(expr.escapedText)) {
|
|
72277
|
-
return +(expr.escapedText);
|
|
72278
|
-
}
|
|
72279
|
-
case 207:
|
|
72280
|
-
if (ts.isEntityNameExpression(expr)) {
|
|
72281
|
-
var symbol = resolveEntityName(expr, 111551, true);
|
|
72282
|
-
if (symbol) {
|
|
72283
|
-
if (symbol.flags & 8) {
|
|
72284
|
-
return evaluateEnumMember(expr, symbol, location);
|
|
72257
|
+
break;
|
|
72258
|
+
case 222:
|
|
72259
|
+
var left = evaluate(expr.left);
|
|
72260
|
+
var right = evaluate(expr.right);
|
|
72261
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
72262
|
+
switch (expr.operatorToken.kind) {
|
|
72263
|
+
case 51: return left | right;
|
|
72264
|
+
case 50: return left & right;
|
|
72265
|
+
case 48: return left >> right;
|
|
72266
|
+
case 49: return left >>> right;
|
|
72267
|
+
case 47: return left << right;
|
|
72268
|
+
case 52: return left ^ right;
|
|
72269
|
+
case 41: return left * right;
|
|
72270
|
+
case 43: return left / right;
|
|
72271
|
+
case 39: return left + right;
|
|
72272
|
+
case 40: return left - right;
|
|
72273
|
+
case 44: return left % right;
|
|
72274
|
+
case 42: return Math.pow(left, right);
|
|
72285
72275
|
}
|
|
72286
|
-
|
|
72287
|
-
|
|
72288
|
-
|
|
72289
|
-
|
|
72276
|
+
}
|
|
72277
|
+
else if (typeof left === "string" && typeof right === "string" && expr.operatorToken.kind === 39) {
|
|
72278
|
+
return left + right;
|
|
72279
|
+
}
|
|
72280
|
+
break;
|
|
72281
|
+
case 10:
|
|
72282
|
+
case 14:
|
|
72283
|
+
return expr.text;
|
|
72284
|
+
case 8:
|
|
72285
|
+
checkGrammarNumericLiteral(expr);
|
|
72286
|
+
return +expr.text;
|
|
72287
|
+
case 213:
|
|
72288
|
+
return evaluate(expr.expression);
|
|
72289
|
+
case 79:
|
|
72290
|
+
var identifier = expr;
|
|
72291
|
+
if (ts.isInfinityOrNaNString(identifier.escapedText)) {
|
|
72292
|
+
return +(identifier.escapedText);
|
|
72293
|
+
}
|
|
72294
|
+
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
|
|
72295
|
+
case 208:
|
|
72296
|
+
case 207:
|
|
72297
|
+
if (isConstantMemberAccess(expr)) {
|
|
72298
|
+
var type = getTypeOfExpression(expr.expression);
|
|
72299
|
+
if (type.symbol && type.symbol.flags & 384) {
|
|
72300
|
+
var name = void 0;
|
|
72301
|
+
if (expr.kind === 207) {
|
|
72302
|
+
name = expr.name.escapedText;
|
|
72303
|
+
}
|
|
72304
|
+
else {
|
|
72305
|
+
name = ts.escapeLeadingUnderscores(ts.cast(expr.argumentExpression, ts.isLiteralExpression).text);
|
|
72290
72306
|
}
|
|
72307
|
+
return evaluateEnumMember(expr, type.symbol, name);
|
|
72291
72308
|
}
|
|
72292
72309
|
}
|
|
72293
|
-
|
|
72294
|
-
|
|
72295
|
-
|
|
72296
|
-
|
|
72297
|
-
|
|
72298
|
-
|
|
72299
|
-
|
|
72300
|
-
|
|
72301
|
-
|
|
72302
|
-
|
|
72303
|
-
|
|
72304
|
-
}
|
|
72310
|
+
break;
|
|
72311
|
+
}
|
|
72312
|
+
return undefined;
|
|
72313
|
+
}
|
|
72314
|
+
function evaluateEnumMember(expr, enumSymbol, name) {
|
|
72315
|
+
var memberSymbol = enumSymbol.exports.get(name);
|
|
72316
|
+
if (memberSymbol) {
|
|
72317
|
+
var declaration = memberSymbol.valueDeclaration;
|
|
72318
|
+
if (declaration !== member) {
|
|
72319
|
+
if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member) && ts.isEnumDeclaration(declaration.parent)) {
|
|
72320
|
+
return getEnumMemberValue(declaration);
|
|
72305
72321
|
}
|
|
72322
|
+
error(expr, ts.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums);
|
|
72323
|
+
return 0;
|
|
72306
72324
|
}
|
|
72307
|
-
|
|
72308
|
-
|
|
72309
|
-
|
|
72310
|
-
|
|
72311
|
-
function evaluateEnumMember(expr, symbol, location) {
|
|
72312
|
-
var declaration = symbol.valueDeclaration;
|
|
72313
|
-
if (!declaration || declaration === location) {
|
|
72314
|
-
error(expr, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(symbol));
|
|
72325
|
+
else {
|
|
72326
|
+
error(expr, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(memberSymbol));
|
|
72327
|
+
}
|
|
72328
|
+
}
|
|
72315
72329
|
return undefined;
|
|
72316
72330
|
}
|
|
72317
|
-
|
|
72318
|
-
|
|
72319
|
-
|
|
72331
|
+
}
|
|
72332
|
+
function isConstantMemberAccess(node) {
|
|
72333
|
+
var type = getTypeOfExpression(node);
|
|
72334
|
+
if (type === errorType) {
|
|
72335
|
+
return false;
|
|
72320
72336
|
}
|
|
72321
|
-
return
|
|
72337
|
+
return node.kind === 79 ||
|
|
72338
|
+
node.kind === 207 && isConstantMemberAccess(node.expression) ||
|
|
72339
|
+
node.kind === 208 && isConstantMemberAccess(node.expression) &&
|
|
72340
|
+
ts.isStringLiteralLike(node.argumentExpression);
|
|
72322
72341
|
}
|
|
72323
72342
|
function checkEnumDeclaration(node) {
|
|
72324
72343
|
addLazyDiagnostic(function () { return checkEnumDeclarationWorker(node); });
|
|
@@ -99884,10 +99903,12 @@ var ts;
|
|
|
99884
99903
|
if (options.preserveConstEnums === false) {
|
|
99885
99904
|
createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules");
|
|
99886
99905
|
}
|
|
99887
|
-
var
|
|
99888
|
-
|
|
99889
|
-
|
|
99890
|
-
|
|
99906
|
+
for (var _a = 0, files_5 = files; _a < files_5.length; _a++) {
|
|
99907
|
+
var file = files_5[_a];
|
|
99908
|
+
if (!ts.isExternalModule(file) && !ts.isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6) {
|
|
99909
|
+
var span = ts.getErrorSpanForNode(file, file);
|
|
99910
|
+
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)));
|
|
99911
|
+
}
|
|
99891
99912
|
}
|
|
99892
99913
|
}
|
|
99893
99914
|
else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 && options.module === ts.ModuleKind.None) {
|
|
@@ -105872,9 +105893,7 @@ var ts;
|
|
|
105872
105893
|
}
|
|
105873
105894
|
}
|
|
105874
105895
|
}
|
|
105875
|
-
var seenRefs = buildInfoPath ? new ts.Set() : undefined;
|
|
105876
105896
|
var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
105877
|
-
seenRefs === null || seenRefs === void 0 ? void 0 : seenRefs.add(resolvedPath);
|
|
105878
105897
|
var pseudoUpToDate = false;
|
|
105879
105898
|
var usesPrepend = false;
|
|
105880
105899
|
var upstreamChangedProject;
|
|
@@ -105885,7 +105904,7 @@ var ts;
|
|
|
105885
105904
|
if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
|
|
105886
105905
|
continue;
|
|
105887
105906
|
}
|
|
105888
|
-
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
105907
|
+
if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) {
|
|
105889
105908
|
return {
|
|
105890
105909
|
type: ts.UpToDateStatusType.OutOfDateWithUpstream,
|
|
105891
105910
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -105936,24 +105955,9 @@ var ts;
|
|
|
105936
105955
|
oldestOutputFileName: oldestOutputFileName
|
|
105937
105956
|
};
|
|
105938
105957
|
}
|
|
105939
|
-
function hasSameBuildInfo(state, buildInfoCacheEntry,
|
|
105940
|
-
if (seenRefs.has(resolvedRefPath))
|
|
105941
|
-
return false;
|
|
105942
|
-
seenRefs.add(resolvedRefPath);
|
|
105958
|
+
function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
105943
105959
|
var refBuildInfo = state.buildInfoCache.get(resolvedRefPath);
|
|
105944
|
-
|
|
105945
|
-
return true;
|
|
105946
|
-
if (resolvedConfig.projectReferences) {
|
|
105947
|
-
for (var _i = 0, _a = resolvedConfig.projectReferences; _i < _a.length; _i++) {
|
|
105948
|
-
var ref = _a[_i];
|
|
105949
|
-
var resolvedRef = ts.resolveProjectReferencePath(ref);
|
|
105950
|
-
var resolvedRefPath_1 = toResolvedConfigFilePath(state, resolvedRef);
|
|
105951
|
-
var resolvedConfig_1 = parseConfigFile(state, resolvedRef, resolvedRefPath_1);
|
|
105952
|
-
if (hasSameBuildInfo(state, buildInfoCacheEntry, seenRefs, resolvedConfig_1, resolvedRefPath_1))
|
|
105953
|
-
return true;
|
|
105954
|
-
}
|
|
105955
|
-
}
|
|
105956
|
-
return false;
|
|
105960
|
+
return refBuildInfo.path === buildInfoCacheEntry.path;
|
|
105957
105961
|
}
|
|
105958
105962
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
105959
105963
|
if (project === undefined) {
|