diff --git a/lib/.gitattributes b/lib/.gitattributes
index fcadb2cf979..07764a78d98 100644
--- a/lib/.gitattributes
+++ b/lib/.gitattributes
@@ -1 +1 @@
-* text eol=lf
+* text eol=lf
\ No newline at end of file
diff --git a/lib/cancellationToken.js b/lib/cancellationToken.js
index 39000bb9f7d..d63145f3fc5 100644
--- a/lib/cancellationToken.js
+++ b/lib/cancellationToken.js
@@ -13,6 +13,7 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
"use strict";
var fs = require("fs");
function pipeExists(name) {
diff --git a/lib/tsc.js b/lib/tsc.js
index 83058b911c5..00c1db6c1b5 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -13,100 +13,20 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
"use strict";"use strict";
-/*@internal*/
-var ts;
-(function (ts) {
- /** Gets a timestamp with (at least) ms resolution */
- ts.timestamp = typeof performance !== "undefined" && performance.now ? function () { return performance.now(); } : Date.now ? Date.now : function () { return +(new Date()); };
-})(ts || (ts = {}));
-/*@internal*/
-/** Performance measurements for the compiler. */
-(function (ts) {
- var performance;
- (function (performance) {
- // NOTE: cannot use ts.noop as core.ts loads after this
- var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : function () { };
- var enabled = false;
- var profilerStart = 0;
- var counts;
- var marks;
- var measures;
- /**
- * Marks a performance event.
- *
- * @param markName The name of the mark.
- */
- function mark(markName) {
- if (enabled) {
- marks.set(markName, ts.timestamp());
- counts.set(markName, (counts.get(markName) || 0) + 1);
- profilerEvent(markName);
- }
- }
- performance.mark = mark;
- /**
- * Adds a performance measurement with the specified name.
- *
- * @param measureName The name of the performance measurement.
- * @param startMarkName The name of the starting mark. If not supplied, the point at which the
- * profiler was enabled is used.
- * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is
- * used.
- */
- function measure(measureName, startMarkName, endMarkName) {
- if (enabled) {
- var end = endMarkName && marks.get(endMarkName) || ts.timestamp();
- var start = startMarkName && marks.get(startMarkName) || profilerStart;
- measures.set(measureName, (measures.get(measureName) || 0) + (end - start));
- }
- }
- performance.measure = measure;
- /**
- * Gets the number of times a marker was encountered.
- *
- * @param markName The name of the mark.
- */
- function getCount(markName) {
- return counts && counts.get(markName) || 0;
- }
- performance.getCount = getCount;
- /**
- * Gets the total duration of all measurements with the supplied name.
- *
- * @param measureName The name of the measure whose durations should be accumulated.
- */
- function getDuration(measureName) {
- return measures && measures.get(measureName) || 0;
- }
- performance.getDuration = getDuration;
- /**
- * Iterate over each measure, performing some action
- *
- * @param cb The action to perform for each measure
- */
- function forEachMeasure(cb) {
- measures.forEach(function (measure, key) {
- cb(key, measure);
- });
- }
- performance.forEachMeasure = forEachMeasure;
- /** Enables (and resets) performance measurements for the compiler. */
- function enable() {
- counts = ts.createMap();
- marks = ts.createMap();
- measures = ts.createMap();
- enabled = true;
- profilerStart = ts.timestamp();
- }
- performance.enable = enable;
- /** Disables performance measurements for the compiler. */
- function disable() {
- enabled = false;
- }
- performance.disable = disable;
- })(performance = ts.performance || (ts.performance = {}));
-})(ts || (ts = {}));
+var __assign = (this && this.__assign) || Object.assign || function(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
+ t[p] = s[p];
+ }
+ return t;
+};
+var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
+ return cooked;
+};
var ts;
(function (ts) {
// WARNING: The script `configureNightly.ts` uses a regexp to parse out these values.
@@ -115,14 +35,17 @@ var ts;
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".0-dev";
})(ts || (ts = {}));
-/* @internal */
(function (ts) {
+ /* @internal */
var Comparison;
(function (Comparison) {
Comparison[Comparison["LessThan"] = -1] = "LessThan";
Comparison[Comparison["EqualTo"] = 0] = "EqualTo";
Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan";
})(Comparison = ts.Comparison || (ts.Comparison = {}));
+})(ts || (ts = {}));
+/* @internal */
+(function (ts) {
/** Create a MapLike with good performance. */
function createDictionaryObject() {
var map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword
@@ -1984,16 +1907,99 @@ var ts;
}
ts.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes;
})(ts || (ts = {}));
-//# sourceMappingURL=core.js.map
-"use strict";
-var __assign = (this && this.__assign) || Object.assign || function(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
-};
+/*@internal*/
+var ts;
+(function (ts) {
+ /** Gets a timestamp with (at least) ms resolution */
+ ts.timestamp = typeof performance !== "undefined" && performance.now ? function () { return performance.now(); } : Date.now ? Date.now : function () { return +(new Date()); };
+})(ts || (ts = {}));
+/*@internal*/
+/** Performance measurements for the compiler. */
+(function (ts) {
+ var performance;
+ (function (performance) {
+ // NOTE: cannot use ts.noop as core.ts loads after this
+ var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : function () { };
+ var enabled = false;
+ var profilerStart = 0;
+ var counts;
+ var marks;
+ var measures;
+ /**
+ * Marks a performance event.
+ *
+ * @param markName The name of the mark.
+ */
+ function mark(markName) {
+ if (enabled) {
+ marks.set(markName, ts.timestamp());
+ counts.set(markName, (counts.get(markName) || 0) + 1);
+ profilerEvent(markName);
+ }
+ }
+ performance.mark = mark;
+ /**
+ * Adds a performance measurement with the specified name.
+ *
+ * @param measureName The name of the performance measurement.
+ * @param startMarkName The name of the starting mark. If not supplied, the point at which the
+ * profiler was enabled is used.
+ * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is
+ * used.
+ */
+ function measure(measureName, startMarkName, endMarkName) {
+ if (enabled) {
+ var end = endMarkName && marks.get(endMarkName) || ts.timestamp();
+ var start = startMarkName && marks.get(startMarkName) || profilerStart;
+ measures.set(measureName, (measures.get(measureName) || 0) + (end - start));
+ }
+ }
+ performance.measure = measure;
+ /**
+ * Gets the number of times a marker was encountered.
+ *
+ * @param markName The name of the mark.
+ */
+ function getCount(markName) {
+ return counts && counts.get(markName) || 0;
+ }
+ performance.getCount = getCount;
+ /**
+ * Gets the total duration of all measurements with the supplied name.
+ *
+ * @param measureName The name of the measure whose durations should be accumulated.
+ */
+ function getDuration(measureName) {
+ return measures && measures.get(measureName) || 0;
+ }
+ performance.getDuration = getDuration;
+ /**
+ * Iterate over each measure, performing some action
+ *
+ * @param cb The action to perform for each measure
+ */
+ function forEachMeasure(cb) {
+ measures.forEach(function (measure, key) {
+ cb(key, measure);
+ });
+ }
+ performance.forEachMeasure = forEachMeasure;
+ /** Enables (and resets) performance measurements for the compiler. */
+ function enable() {
+ counts = ts.createMap();
+ marks = ts.createMap();
+ measures = ts.createMap();
+ enabled = true;
+ profilerStart = ts.timestamp();
+ }
+ performance.enable = enable;
+ /** Disables performance measurements for the compiler. */
+ function disable() {
+ enabled = false;
+ }
+ performance.disable = disable;
+ })(performance = ts.performance || (ts.performance = {}));
+})(ts || (ts = {}));
var ts;
(function (ts) {
// token > SyntaxKind.Identifier => token is a keyword
@@ -4270,8 +4276,8 @@ var ts;
var entries = _fs.readdirSync(path || ".").sort();
var files = [];
var directories = [];
- for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
- var entry = entries_1[_i];
+ for (var _i = 0, entries_2 = entries; _i < entries_2.length; _i++) {
+ var entry = entries_2[_i];
// This is necessary because on some file system node fails to exclude
// "." and "..". See https://github.com/nodejs/node/issues/4002
if (entry === "." || entry === "..") {
@@ -4451,7 +4457,7 @@ var ts;
}
})(ts || (ts = {}));
//
-// generated from './diagnosticInformationMap.generated.ts' by 'src\parser'
+// generated from './diagnosticInformationMap.generated.ts' by 'src\compiler'
/* @internal */
var ts;
(function (ts) {
@@ -7445,11 +7451,6 @@ var ts;
/** Non-internal stuff goes here */
var ts;
(function (ts) {
- ts.emptyArray = [];
- function closeFileWatcher(watcher) {
- watcher.close();
- }
- ts.closeFileWatcher = closeFileWatcher;
function isExternalModuleNameRelative(moduleName) {
// TypeScript 1.0 spec (April 2014): 11.2.1
// An external module name is "relative" if the first term is "." or "..".
@@ -7461,20 +7462,10 @@ var ts;
return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics);
}
ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics;
- function toPath(fileName, basePath, getCanonicalFileName) {
- var nonCanonicalizedPath = ts.isRootedDiskPath(fileName)
- ? ts.normalizePath(fileName)
- : ts.getNormalizedAbsolutePath(fileName, basePath);
- return getCanonicalFileName(nonCanonicalizedPath);
- }
- ts.toPath = toPath;
- function hasEntries(map) {
- return !!map && !!map.size;
- }
- ts.hasEntries = hasEntries;
})(ts || (ts = {}));
/* @internal */
(function (ts) {
+ ts.emptyArray = [];
ts.resolvingEmptyArray = [];
ts.emptyMap = ts.createMap();
ts.emptyUnderscoreEscapedMap = ts.emptyMap;
@@ -7497,6 +7488,10 @@ var ts;
return new ts.MapCtr();
}
ts.createUnderscoreEscapedMap = createUnderscoreEscapedMap;
+ function hasEntries(map) {
+ return !!map && !!map.size;
+ }
+ ts.hasEntries = hasEntries;
function createSymbolTable(symbols) {
var result = ts.createMap();
if (symbols) {
@@ -7543,6 +7538,13 @@ var ts;
reportPrivateInBaseOfClassExpression: ts.noop,
};
}
+ function toPath(fileName, basePath, getCanonicalFileName) {
+ var nonCanonicalizedPath = ts.isRootedDiskPath(fileName)
+ ? ts.normalizePath(fileName)
+ : ts.getNormalizedAbsolutePath(fileName, basePath);
+ return getCanonicalFileName(nonCanonicalizedPath);
+ }
+ ts.toPath = toPath;
function changesAffectModuleResolution(oldOptions, newOptions) {
return !oldOptions ||
(oldOptions.module !== newOptions.module) ||
@@ -10372,7 +10374,7 @@ var ts;
*/
function getExternalModuleNameFromPath(host, fileName, referencePath) {
var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); };
- var dir = ts.toPath(referencePath ? ts.getDirectoryPath(referencePath) : host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName);
+ var dir = toPath(referencePath ? ts.getDirectoryPath(referencePath) : host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName);
var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory());
var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
var extensionless = ts.removeFileExtension(relativePath);
@@ -11280,6 +11282,10 @@ var ts;
return options.watch && options.hasOwnProperty("watch");
}
ts.isWatchSet = isWatchSet;
+ function closeFileWatcher(watcher) {
+ watcher.close();
+ }
+ ts.closeFileWatcher = closeFileWatcher;
function getCheckFlags(symbol) {
return symbol.flags & 33554432 /* Transient */ ? symbol.checkFlags : 0;
}
@@ -13702,6 +13708,9 @@ var ts;
return node.kind === 9 /* StringLiteral */ || node.kind === 13 /* NoSubstitutionTemplateLiteral */;
}
ts.isStringLiteralLike = isStringLiteralLike;
+})(ts || (ts = {}));
+/* @internal */
+(function (ts) {
/** @internal */
function isNamedImportsOrExports(node) {
return node.kind === 247 /* NamedImports */ || node.kind === 251 /* NamedExports */;
@@ -13718,7 +13727,7 @@ var ts;
}
function Type(checker, flags) {
this.flags = flags;
- if (Debug.isDebugging) {
+ if (ts.Debug.isDebugging) {
this.checker = checker;
}
}
@@ -13749,9 +13758,10 @@ var ts;
getSignatureConstructor: function () { return Signature; },
getSourceMapSourceConstructor: function () { return SourceMapSource; },
};
+ /* @internal */
function formatStringFromArgs(text, args, baseIndex) {
if (baseIndex === void 0) { baseIndex = 0; }
- return text.replace(/{(\d+)}/g, function (_match, index) { return Debug.assertDefined(args[+index + baseIndex]); });
+ return text.replace(/{(\d+)}/g, function (_match, index) { return ts.Debug.assertDefined(args[+index + baseIndex]); });
}
ts.formatStringFromArgs = formatStringFromArgs;
function getLocaleSpecificMessage(message) {
@@ -13759,11 +13769,11 @@ var ts;
}
ts.getLocaleSpecificMessage = getLocaleSpecificMessage;
function createFileDiagnostic(file, start, length, message) {
- Debug.assertGreaterThanOrEqual(start, 0);
- Debug.assertGreaterThanOrEqual(length, 0);
+ ts.Debug.assertGreaterThanOrEqual(start, 0);
+ ts.Debug.assertGreaterThanOrEqual(length, 0);
if (file) {
- Debug.assertLessThanOrEqual(start, file.text.length);
- Debug.assertLessThanOrEqual(start + length, file.text.length);
+ ts.Debug.assertLessThanOrEqual(start, file.text.length);
+ ts.Debug.assertLessThanOrEqual(start + length, file.text.length);
}
var text = getLocaleSpecificMessage(message);
if (arguments.length > 4) {
@@ -13805,6 +13815,7 @@ var ts;
};
}
ts.createCompilerDiagnostic = createCompilerDiagnostic;
+ /* @internal */
function createCompilerDiagnosticFromMessageChain(chain) {
return {
file: undefined,
@@ -13841,6 +13852,7 @@ var ts;
function getDiagnosticFilePath(diagnostic) {
return diagnostic.file ? diagnostic.file.path : undefined;
}
+ /* @internal */
function compareDiagnostics(d1, d2) {
return ts.compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d2)) ||
ts.compareValues(d1.start, d2.start) ||
@@ -14055,7 +14067,7 @@ var ts;
ts.getRootLength = getRootLength;
// TODO(rbuckton): replace references with `resolvePath`
function normalizePath(path) {
- return resolvePath(path);
+ return ts.resolvePath(path);
}
ts.normalizePath = normalizePath;
function normalizePathAndParts(path) {
@@ -14063,7 +14075,7 @@ var ts;
var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1);
if (parts.length) {
var joinedParts = root + parts.join(ts.directorySeparator);
- return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts };
+ return { path: ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts };
}
else {
return { path: root, parts: parts };
@@ -14078,7 +14090,7 @@ var ts;
return path;
// return the leading portion of the path up to the last (non-terminal) directory separator
// but not including any trailing directory separator.
- path = removeTrailingDirectorySeparator(path);
+ path = ts.removeTrailingDirectorySeparator(path);
return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator)));
}
ts.getDirectoryPath = getDirectoryPath;
@@ -14106,10 +14118,11 @@ var ts;
return rootLength > 0 && rootLength === path.length;
}
ts.isDiskPathRoot = isDiskPathRoot;
+ /* @internal */
function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) {
return !isRootedDiskPath(absoluteOrRelativePath)
? absoluteOrRelativePath
- : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
+ : ts.getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
}
ts.convertToRelativePath = convertToRelativePath;
function pathComponents(path, rootLength) {
@@ -14127,7 +14140,7 @@ var ts;
*/
function getPathComponents(path, currentDirectory) {
if (currentDirectory === void 0) { currentDirectory = ""; }
- path = combinePaths(currentDirectory, path);
+ path = ts.combinePaths(currentDirectory, path);
var rootLength = getRootLength(path);
return pathComponents(path, rootLength);
}
@@ -14182,15 +14195,18 @@ var ts;
function getPathFromPathComponents(pathComponents) {
if (pathComponents.length === 0)
return "";
- var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]);
+ var root = pathComponents[0] && ts.ensureTrailingDirectorySeparator(pathComponents[0]);
if (pathComponents.length === 1)
return root;
return root + pathComponents.slice(1).join(ts.directorySeparator);
}
ts.getPathFromPathComponents = getPathFromPathComponents;
+})(ts || (ts = {}));
+/* @internal */
+(function (ts) {
function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) {
- var fromComponents = reducePathComponents(getPathComponents(from));
- var toComponents = reducePathComponents(getPathComponents(to));
+ var fromComponents = ts.reducePathComponents(ts.getPathComponents(from));
+ var toComponents = ts.reducePathComponents(ts.getPathComponents(to));
var start;
for (start = 0; start < fromComponents.length && start < toComponents.length; start++) {
var fromComponent = getCanonicalFileName(fromComponents[start]);
@@ -14209,26 +14225,27 @@ var ts;
}
return [""].concat(relative, components);
}
+ ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
function getRelativePathFromFile(from, to, getCanonicalFileName) {
- return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName));
+ return ensurePathIsNonModuleName(getRelativePathFromDirectory(ts.getDirectoryPath(from), to, getCanonicalFileName));
}
ts.getRelativePathFromFile = getRelativePathFromFile;
function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
- Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative");
+ Debug.assert((ts.getRootLength(fromDirectory) > 0) === (ts.getRootLength(to) > 0), "Paths must either both be absolute or both be relative");
var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity;
var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false;
var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName);
- return getPathFromPathComponents(pathComponents);
+ return ts.getPathFromPathComponents(pathComponents);
}
ts.getRelativePathFromDirectory = getRelativePathFromDirectory;
function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) {
var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName);
var firstComponent = pathComponents[0];
- if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) {
+ if (isAbsolutePathAnUrl && ts.isRootedDiskPath(firstComponent)) {
var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///";
pathComponents[0] = prefix + firstComponent;
}
- return getPathFromPathComponents(pathComponents);
+ return ts.getPathFromPathComponents(pathComponents);
}
ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl;
/**
@@ -14236,19 +14253,19 @@ var ts;
* with `./` or `../`) so as not to be confused with an unprefixed module name.
*/
function ensurePathIsNonModuleName(path) {
- return getRootLength(path) === 0 && !pathIsRelative(path) ? "./" + path : path;
+ return ts.getRootLength(path) === 0 && !ts.pathIsRelative(path) ? "./" + path : path;
}
ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName;
function getBaseFileName(path, extensions, ignoreCase) {
- path = normalizeSlashes(path);
+ path = ts.normalizeSlashes(path);
// if the path provided is itself the root, then it has not file name.
- var rootLength = getRootLength(path);
+ var rootLength = ts.getRootLength(path);
if (rootLength === path.length)
return "";
// return the trailing portion of the path starting after the last (non-terminal) directory
// separator but not including any trailing directory separator.
path = removeTrailingDirectorySeparator(path);
- var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1));
+ var name = path.slice(Math.max(ts.getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1));
var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined;
return extension ? name.slice(0, name.length - extension.length) : name;
}
@@ -14262,13 +14279,13 @@ var ts;
paths[_i - 1] = arguments[_i];
}
if (path)
- path = normalizeSlashes(path);
+ path = ts.normalizeSlashes(path);
for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) {
var relativePath = paths_1[_a];
if (!relativePath)
continue;
- relativePath = normalizeSlashes(relativePath);
- if (!path || getRootLength(relativePath) !== 0) {
+ relativePath = ts.normalizeSlashes(relativePath);
+ if (!path || ts.getRootLength(relativePath) !== 0) {
path = relativePath;
}
else {
@@ -14287,8 +14304,8 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
paths[_i - 1] = arguments[_i];
}
- var combined = ts.some(paths) ? combinePaths.apply(void 0, [path].concat(paths)) : normalizeSlashes(path);
- var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(combined)));
+ var combined = ts.some(paths) ? combinePaths.apply(void 0, [path].concat(paths)) : ts.normalizeSlashes(path);
+ var normalized = ts.getPathFromPathComponents(ts.reducePathComponents(ts.getPathComponents(combined)));
return normalized && hasTrailingDirectorySeparator(combined) ? ensureTrailingDirectorySeparator(normalized) : normalized;
}
ts.resolvePath = resolvePath;
@@ -14323,8 +14340,8 @@ var ts;
return -1 /* LessThan */;
if (b === undefined)
return 1 /* GreaterThan */;
- var aComponents = reducePathComponents(getPathComponents(a));
- var bComponents = reducePathComponents(getPathComponents(b));
+ var aComponents = ts.reducePathComponents(ts.getPathComponents(a));
+ var bComponents = ts.reducePathComponents(ts.getPathComponents(b));
var sharedLength = Math.min(aComponents.length, bComponents.length);
for (var i = 0; i < sharedLength; i++) {
var stringComparer = i === 0 ? ts.compareStringsCaseInsensitive : componentComparer;
@@ -14372,8 +14389,8 @@ var ts;
return false;
if (parent === child)
return true;
- var parentComponents = reducePathComponents(getPathComponents(parent));
- var childComponents = reducePathComponents(getPathComponents(child));
+ var parentComponents = ts.reducePathComponents(ts.getPathComponents(parent));
+ var childComponents = ts.reducePathComponents(ts.getPathComponents(child));
if (childComponents.length < parentComponents.length) {
return false;
}
@@ -14476,7 +14493,7 @@ var ts;
var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter;
var subpattern = "";
var hasWrittenComponent = false;
- var components = getNormalizedPathComponents(spec, basePath);
+ var components = ts.getNormalizedPathComponents(spec, basePath);
var lastComponent = ts.last(components);
if (usage !== "exclude" && lastComponent === "**") {
return undefined;
@@ -14543,8 +14560,8 @@ var ts;
}
/** @param path directory of the tsconfig.json */
function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
- path = normalizePath(path);
- currentDirectory = normalizePath(currentDirectory);
+ path = ts.normalizePath(path);
+ currentDirectory = ts.normalizePath(currentDirectory);
var absolutePath = combinePaths(currentDirectory, path);
return {
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
@@ -14561,8 +14578,8 @@ var ts;
ts.getRegexFromPattern = getRegexFromPattern;
/** @param path directory of the tsconfig.json */
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries) {
- path = normalizePath(path);
- currentDirectory = normalizePath(currentDirectory);
+ path = ts.normalizePath(path);
+ currentDirectory = ts.normalizePath(currentDirectory);
var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return getRegexFromPattern(pattern, useCaseSensitiveFileNames); });
var includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);
@@ -14629,7 +14646,7 @@ var ts;
var include = includes_1[_i];
// We also need to check the relative paths by converting them to absolute and normalizing
// in case they escape the base path (e.g "..\somedirectory")
- var absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include));
+ var absolute = ts.isRootedDiskPath(include) ? include : ts.normalizePath(combinePaths(path, include));
// Append the literal and canonical candidate base paths.
includeBasePaths.push(getIncludeBasePath(absolute));
}
@@ -14655,7 +14672,7 @@ var ts;
// No "*" or "?" in the path
return !hasExtension(absolute)
? absolute
- : removeTrailingDirectorySeparator(getDirectoryPath(absolute));
+ : removeTrailingDirectorySeparator(ts.getDirectoryPath(absolute));
}
return absolute.substring(0, absolute.lastIndexOf(ts.directorySeparator, wildcardOffset));
}
@@ -14832,7 +14849,7 @@ var ts;
})(Debug = ts.Debug || (ts.Debug = {}));
function tryParsePattern(pattern) {
// This should be verified outside of here and a proper error thrown.
- Debug.assert(hasZeroOrOneAsteriskCharacter(pattern));
+ Debug.assert(ts.hasZeroOrOneAsteriskCharacter(pattern));
var indexOfStar = pattern.indexOf("*");
return indexOfStar === -1 ? undefined : {
prefix: pattern.substr(0, indexOfStar),
@@ -14875,8 +14892,8 @@ var ts;
function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) {
if (typeof extensions === "string")
extensions = [extensions];
- for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) {
- var extension = extensions_1[_i];
+ for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) {
+ var extension = extensions_2[_i];
if (!ts.startsWith(extension, "."))
extension = "." + extension;
if (path.length >= extension.length && path.charAt(path.length - extension.length) === ".") {
@@ -21349,8 +21366,8 @@ var ts;
array._children = undefined;
array.pos += delta;
array.end += delta;
- for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {
- var node = array_1[_i];
+ for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
+ var node = array_8[_i];
visitNode(node);
}
}
@@ -21500,8 +21517,8 @@ var ts;
array._children = undefined;
// Adjust the pos or end (or both) of the intersecting array accordingly.
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
- for (var _i = 0, array_2 = array; _i < array_2.length; _i++) {
- var node = array_2[_i];
+ for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
+ var node = array_9[_i];
visitNode(node);
}
return;
@@ -25337,20 +25354,6 @@ var ts;
return value !== undefined ? { value: value } : undefined;
}
})(ts || (ts = {}));
-//# sourceMappingURL=parser.js.map
-"use strict";
-var __assign = (this && this.__assign) || Object.assign || function(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
-};
-var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
- return cooked;
-};
/* @internal */
var ts;
(function (ts) {
@@ -25911,8 +25914,8 @@ var ts;
var savedSubtreeTransformFlags = subtreeTransformFlags;
subtreeTransformFlags = 0 /* None */;
var nodeArrayFlags = 0 /* None */;
- for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
- var node = nodes_1[_i];
+ for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) {
+ var node = nodes_2[_i];
bindFunction(node);
nodeArrayFlags |= node.transformFlags & ~536870912 /* HasComputedFlags */;
}
@@ -31303,8 +31306,8 @@ var ts;
}
function findConstructorDeclaration(node) {
var members = node.members;
- for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {
- var member = members_1[_i];
+ for (var _i = 0, members_2 = members; _i < members_2.length; _i++) {
+ var member = members_2[_i];
if (member.kind === 155 /* Constructor */ && ts.nodeIsPresent(member.body)) {
return member;
}
@@ -33210,7 +33213,7 @@ var ts;
var definedInConstructor = false;
var definedInMethod = false;
var jsDocType;
- var _loop_1 = function (declaration) {
+ var _loop_4 = function (declaration) {
var declarationInConstructor = false;
var expression = declaration.kind === 200 /* BinaryExpression */ ? declaration :
declaration.kind === 185 /* PropertyAccessExpression */ ? ts.cast(declaration.parent, ts.isBinaryExpression) :
@@ -33253,20 +33256,20 @@ var ts;
special === 2 /* ModuleExports */ &&
symbol.escapedName === "export=" /* ExportEquals */) {
var exportedType_1 = resolveStructuredTypeMembers(type_2);
- var members_2 = ts.createSymbolTable();
- ts.copyEntries(exportedType_1.members, members_2);
+ var members_3 = ts.createSymbolTable();
+ ts.copyEntries(exportedType_1.members, members_3);
symbol.exports.forEach(function (s, name) {
- if (members_2.has(name)) {
+ if (members_3.has(name)) {
var exportedMember = exportedType_1.members.get(name);
var union = createSymbol(s.flags | exportedMember.flags, name);
union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
- members_2.set(name, union);
+ members_3.set(name, union);
}
else {
- members_2.set(name, s);
+ members_3.set(name, s);
}
});
- type_2 = createAnonymousType(exportedType_1.symbol, members_2, exportedType_1.callSignatures, exportedType_1.constructSignatures, exportedType_1.stringIndexInfo, exportedType_1.numberIndexInfo);
+ type_2 = createAnonymousType(exportedType_1.symbol, members_3, exportedType_1.callSignatures, exportedType_1.constructSignatures, exportedType_1.stringIndexInfo, exportedType_1.numberIndexInfo);
}
var anyedType = type_2;
if (isEmptyArrayLiteralType(type_2)) {
@@ -33283,7 +33286,7 @@ var ts;
};
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- var state_2 = _loop_1(declaration);
+ var state_2 = _loop_4(declaration);
if (typeof state_2 === "object")
return state_2.value;
}
@@ -33752,8 +33755,8 @@ var ts;
// The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set
// in-place and returns the same array.
function appendTypeParameters(typeParameters, declarations) {
- for (var _i = 0, declarations_1 = declarations; _i < declarations_1.length; _i++) {
- var declaration = declarations_1[_i];
+ for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) {
+ var declaration = declarations_2[_i];
typeParameters = ts.appendIfUnique(typeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)));
}
return typeParameters;
@@ -34331,8 +34334,8 @@ var ts;
// we check symbols to see if we can quickly conclude they are free of "this" references, thus needing no instantiation.
function createInstantiatedSymbolTable(symbols, mapper, mappingThisOnly) {
var result = ts.createSymbolTable();
- for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) {
- var symbol = symbols_1[_i];
+ for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) {
+ var symbol = symbols_2[_i];
result.set(symbol.escapedName, mappingThisOnly && isThisless(symbol) ? symbol : instantiateSymbol(symbol, mapper));
}
return result;
@@ -34482,9 +34485,9 @@ var ts;
// If we have an existing early-bound member, combine its declarations so that we can
// report an error at each declaration.
var declarations = earlySymbol ? ts.concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
- var name_1 = ts.declarationNameToString(decl.name);
- ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Duplicate_declaration_0, name_1); });
- error(decl.name || decl, ts.Diagnostics.Duplicate_declaration_0, name_1);
+ var name_2 = ts.declarationNameToString(decl.name);
+ ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Duplicate_declaration_0, name_2); });
+ error(decl.name || decl, ts.Diagnostics.Duplicate_declaration_0, name_2);
lateSymbol = createSymbol(0 /* None */, memberName, 1024 /* Late */);
}
lateSymbol.nameType = type;
@@ -34517,8 +34520,8 @@ var ts;
var decl = _a[_i];
var members = ts.getMembersOfDeclaration(decl);
if (members) {
- for (var _b = 0, members_3 = members; _b < members_3.length; _b++) {
- var member = members_3[_b];
+ for (var _b = 0, members_4 = members; _b < members_4.length; _b++) {
+ var member = members_4[_b];
if (isStatic === ts.hasStaticModifier(member) && hasLateBindableName(member)) {
lateBindMember(symbol, earlySymbols, lateSymbols, member);
}
@@ -34794,7 +34797,7 @@ var ts;
var numberIndexInfo;
var types = type.types;
var mixinCount = ts.countWhere(types, isMixinConstructorType);
- var _loop_2 = function (i) {
+ var _loop_5 = function (i) {
var t = type.types[i];
// When an intersection type contains mixin constructor types, the construct signatures from
// those types are discarded and their return types are mixed into the return types of all
@@ -34817,7 +34820,7 @@ var ts;
numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1 /* Number */));
};
for (var i = 0; i < types.length; i++) {
- _loop_2(i);
+ _loop_5(i);
}
setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
}
@@ -36397,8 +36400,8 @@ var ts;
function getTypeOfGlobalSymbol(symbol, arity) {
function getTypeDeclaration(symbol) {
var declarations = symbol.declarations;
- for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) {
- var declaration = declarations_2[_i];
+ for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
+ var declaration = declarations_3[_i];
switch (declaration.kind) {
case 235 /* ClassDeclaration */:
case 236 /* InterfaceDeclaration */:
@@ -36859,7 +36862,7 @@ var ts;
var unionType = types[unionIndex];
var intersection = unionType.types;
var i = types.length - 1;
- var _loop_3 = function () {
+ var _loop_6 = function () {
var t = types[i];
if (t.flags & 67108864 /* UnionOfUnitTypes */) {
intersection = ts.filter(intersection, function (u) { return containsType(t.types, u); });
@@ -36868,7 +36871,7 @@ var ts;
i--;
};
while (i > unionIndex) {
- _loop_3();
+ _loop_6();
}
if (intersection === unionType.types) {
return false;
@@ -38815,7 +38818,7 @@ var ts;
// check excess properties against discriminant type only, not the entire union
return hasExcessProperties(source, discriminant, /*discriminant*/ undefined, reportErrors);
}
- var _loop_4 = function (prop) {
+ var _loop_7 = function (prop) {
if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) {
if (reportErrors) {
// We know *exactly* where things went wrong when comparing the types.
@@ -38854,7 +38857,7 @@ var ts;
};
for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) {
var prop = _a[_i];
- var state_3 = _loop_4(prop);
+ var state_3 = _loop_7(prop);
if (typeof state_3 === "object")
return state_3.value;
}
@@ -39300,10 +39303,10 @@ var ts;
var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
if (modifiersRelated) {
- var result_1;
- if (result_1 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) {
+ var result_2;
+ if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) {
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
- return result_1 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors);
+ return result_2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors);
}
}
return 0 /* False */;
@@ -44630,7 +44633,7 @@ var ts;
// Assignability failure - check each prop individually, and if that fails, fall back on the bad error span
if (ts.length(openingLikeElement.attributes.properties)) {
var reportedError = false;
- var _loop_5 = function (prop) {
+ var _loop_8 = function (prop) {
if (ts.isJsxSpreadAttribute(prop))
return "continue";
var name = ts.idText(prop.name);
@@ -44644,7 +44647,7 @@ var ts;
};
for (var _b = 0, _c = openingLikeElement.attributes.properties; _b < _c.length; _b++) {
var prop = _c[_b];
- _loop_5(prop);
+ _loop_8(prop);
}
if (reportedError) {
return;
@@ -45577,13 +45580,13 @@ var ts;
function getEffectiveCallArguments(node) {
if (node.kind === 189 /* TaggedTemplateExpression */) {
var template = node.template;
- var args_1 = [undefined]; // TODO: GH#18217
+ var args_4 = [undefined]; // TODO: GH#18217
if (template.kind === 202 /* TemplateExpression */) {
ts.forEach(template.templateSpans, function (span) {
- args_1.push(span.expression);
+ args_4.push(span.expression);
});
}
- return args_1;
+ return args_4;
}
else if (node.kind === 150 /* Decorator */) {
// For a decorator, we return undefined as we will determine
@@ -48995,8 +48998,8 @@ var ts;
}
var duplicateFunctionDeclaration = false;
var multipleConstructorImplementation = false;
- for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
- var current = declarations_3[_i];
+ for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
+ var current = declarations_4[_i];
var node = current;
var inAmbientContext = node.flags & 4194304 /* Ambient */;
var inAmbientContextOrInterface = node.parent.kind === 236 /* InterfaceDeclaration */ || node.parent.kind === 166 /* TypeLiteral */ || inAmbientContext;
@@ -49165,10 +49168,10 @@ var ts;
case 243 /* ImportEqualsDeclaration */:
case 246 /* NamespaceImport */:
case 245 /* ImportClause */:
- var result_2 = 0 /* None */;
+ var result_3 = 0 /* None */;
var target = resolveAlias(getSymbolOfNode(d));
- ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); });
- return result_2;
+ ts.forEach(target.declarations, function (d) { result_3 |= getDeclarationSpaces(d); });
+ return result_3;
case 232 /* VariableDeclaration */:
case 182 /* BindingElement */:
case 234 /* FunctionDeclaration */:
@@ -49965,8 +49968,8 @@ var ts;
: ts.createDiagnosticForNode(declarationList.parent.kind === 214 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
}
else {
- for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
- var decl = declarations_4[_i];
+ for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
+ var decl = declarations_5[_i];
addDiagnostic(0 /* Local */, ts.createDiagnosticForNode(decl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.cast(decl.name, ts.isIdentifier))));
}
}
@@ -51150,8 +51153,8 @@ var ts;
if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) {
// Report an error on every conflicting declaration.
var name = symbolToString(symbol);
- for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
- var declaration = declarations_5[_i];
+ for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
+ var declaration = declarations_6[_i];
error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name);
}
}
@@ -51160,8 +51163,8 @@ var ts;
function areTypeParametersIdentical(declarations, targetParameters) {
var maxTypeArgumentCount = ts.length(targetParameters);
var minTypeArgumentCount = getMinTypeArgumentCount(targetParameters);
- for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
- var declaration = declarations_6[_i];
+ for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
+ var declaration = declarations_7[_i];
// If this declaration has too few or too many type parameters, we report an error
var sourceParameters = ts.getEffectiveTypeParameterDeclarations(declaration);
var numTypeParameters = sourceParameters.length;
@@ -51315,7 +51318,7 @@ var ts;
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
// iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
var issuedMemberError = false;
- var _loop_6 = function (member) {
+ var _loop_9 = function (member) {
if (ts.hasStaticModifier(member)) {
return "continue";
}
@@ -51334,7 +51337,7 @@ var ts;
};
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- _loop_6(member);
+ _loop_9(member);
}
if (!issuedMemberError) {
// check again with diagnostics to generate a less-specific error
@@ -51619,12 +51622,12 @@ var ts;
function evaluate(expr) {
switch (expr.kind) {
case 198 /* PrefixUnaryExpression */:
- var value_1 = evaluate(expr.operand);
- if (typeof value_1 === "number") {
+ var value_2 = evaluate(expr.operand);
+ if (typeof value_2 === "number") {
switch (expr.operator) {
- case 37 /* PlusToken */: return value_1;
- case 38 /* MinusToken */: return -value_1;
- case 52 /* TildeToken */: return ~value_1;
+ case 37 /* PlusToken */: return value_2;
+ case 38 /* MinusToken */: return -value_2;
+ case 52 /* TildeToken */: return ~value_2;
}
}
break;
@@ -51763,8 +51766,8 @@ var ts;
}
function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {
var declarations = symbol.declarations;
- for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
- var declaration = declarations_7[_i];
+ for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
+ var declaration = declarations_8[_i];
if ((declaration.kind === 235 /* ClassDeclaration */ ||
(declaration.kind === 234 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) &&
!(declaration.flags & 4194304 /* Ambient */)) {
@@ -52187,9 +52190,9 @@ var ts;
}
}
// Checks for export * conflicts
- var exports = getExportsOfModule(moduleSymbol);
- if (exports) {
- exports.forEach(function (_a, id) {
+ var exports_1 = getExportsOfModule(moduleSymbol);
+ if (exports_1) {
+ exports_1.forEach(function (_a, id) {
var declarations = _a.declarations, flags = _a.flags;
if (id === "__export") {
return;
@@ -52206,8 +52209,8 @@ var ts;
return;
}
if (exportedDeclarationsCount > 1) {
- for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
- var declaration = declarations_8[_i];
+ for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {
+ var declaration = declarations_9[_i];
if (isNotOverload(declaration)) {
diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id)));
}
@@ -54270,8 +54273,8 @@ var ts;
}
function checkGrammarForOmittedArgument(args) {
if (args) {
- for (var _i = 0, args_2 = args; _i < args_2.length; _i++) {
- var arg = args_2[_i];
+ for (var _i = 0, args_5 = args; _i < args_5.length; _i++) {
+ var arg = args_5[_i];
if (arg.kind === 206 /* OmittedExpression */) {
return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
}
@@ -60242,8 +60245,8 @@ var ts;
}
var subtreeFlags = 0 /* None */;
var nodeArrayFlags = 0 /* None */;
- for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) {
- var node = nodes_2[_i];
+ for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) {
+ var node = nodes_3[_i];
subtreeFlags |= aggregateTransformFlagsForNode(node);
nodeArrayFlags |= node.transformFlags & ~536870912 /* HasComputedFlags */;
}
@@ -62308,8 +62311,8 @@ var ts;
function generateClassElementDecorationExpressions(node, isStatic) {
var members = getDecoratedClassElements(node, isStatic);
var expressions;
- for (var _i = 0, members_4 = members; _i < members_4.length; _i++) {
- var member = members_4[_i];
+ for (var _i = 0, members_5 = members; _i < members_5.length; _i++) {
+ var member = members_5[_i];
var expression = generateClassElementDecorationExpression(node, member);
if (expression) {
if (!expressions) {
@@ -74851,8 +74854,8 @@ var ts;
return;
}
necessaryTypeRefernces = necessaryTypeRefernces || ts.createMap();
- for (var _i = 0, typeReferenceDirectives_1 = typeReferenceDirectives; _i < typeReferenceDirectives_1.length; _i++) {
- var ref = typeReferenceDirectives_1[_i];
+ for (var _i = 0, typeReferenceDirectives_2 = typeReferenceDirectives; _i < typeReferenceDirectives_2.length; _i++) {
+ var ref = typeReferenceDirectives_2[_i];
necessaryTypeRefernces.set(ref, true);
}
}
@@ -75760,7 +75763,7 @@ var ts;
var prop = ts.createProperty(/*decorators*/ undefined, maskModifiers(node, /*mask*/ undefined, (!accessors.setAccessor) ? 64 /* Readonly */ : 0 /* None */), node.name, node.questionToken, ensureType(node, accessorType), /*initializer*/ undefined);
var leadingsSyntheticCommentRanges = accessors.secondAccessor && ts.getLeadingCommentRangesOfNode(accessors.secondAccessor, currentSourceFile);
if (leadingsSyntheticCommentRanges) {
- var _loop_7 = function (range) {
+ var _loop_10 = function (range) {
if (range.kind === 3 /* MultiLineCommentTrivia */) {
var text = currentSourceFile.text.slice(range.pos + 2, range.end - 2);
var lines = text.split(/\r\n?|\n/g);
@@ -75774,7 +75777,7 @@ var ts;
};
for (var _i = 0, leadingsSyntheticCommentRanges_1 = leadingsSyntheticCommentRanges; _i < leadingsSyntheticCommentRanges_1.length; _i++) {
var range = leadingsSyntheticCommentRanges_1[_i];
- _loop_7(range);
+ _loop_10(range);
}
}
return prop;
@@ -75983,8 +75986,8 @@ var ts;
}
};
// Ensure the parse tree is clean before applying transformations
- for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) {
- var node = nodes_3[_i];
+ for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) {
+ var node = nodes_4[_i];
ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node)));
}
ts.performance.mark("beforeTransform");
@@ -76175,8 +76178,8 @@ var ts;
function dispose() {
if (state < 3 /* Disposed */) {
// Clean up emit nodes on parse tree
- for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) {
- var node = nodes_4[_i];
+ for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) {
+ var node = nodes_5[_i];
ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node)));
}
// Release references to external entries for GC purposes.
@@ -79732,8 +79735,8 @@ var ts;
function writeLines(text) {
var lines = text.split(/\r\n?|\n/g);
var indentation = ts.guessIndentation(lines);
- for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) {
- var lineText = lines_1[_a];
+ for (var _a = 0, lines_2 = lines; _a < lines_2.length; _a++) {
+ var lineText = lines_2[_a];
var line = indentation ? lineText.slice(indentation) : lineText;
if (line.length) {
writeLine();
@@ -81261,13 +81264,13 @@ var ts;
// which per above occurred during the current program creation.
// Since we assume the filesystem does not change during program creation,
// it is safe to reuse resolutions from the earlier call.
- var result_3 = [];
+ var result_4 = [];
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
var moduleName = moduleNames_1[_i];
var resolvedModule = file.resolvedModules.get(moduleName);
- result_3.push(resolvedModule);
+ result_4.push(resolvedModule);
}
- return result_3;
+ return result_4;
}
// At this point, we know at least one of the following hold:
// - file has local declarations for ambient modules
@@ -81965,8 +81968,8 @@ var ts;
}
break;
}
- for (var _b = 0, nodes_5 = nodes; _b < nodes_5.length; _b++) {
- var node = nodes_5[_b];
+ for (var _b = 0, nodes_6 = nodes; _b < nodes_6.length; _b++) {
+ var node = nodes_6[_b];
walk(node);
}
}
@@ -82623,14 +82626,14 @@ var ts;
if (options.composite && rootNames.length < files.length) {
var normalizedRootNames = rootNames.map(function (r) { return ts.normalizePath(r).toLowerCase(); });
var sourceFiles = files.filter(function (f) { return !f.isDeclarationFile; }).map(function (f) { return ts.normalizePath(f.path).toLowerCase(); });
- var _loop_8 = function (file) {
+ var _loop_11 = function (file) {
if (normalizedRootNames.every(function (r) { return r !== file; })) {
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file));
}
};
for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) {
var file = sourceFiles_4[_i];
- _loop_8(file);
+ _loop_11(file);
}
}
if (options.paths) {
@@ -84499,8 +84502,8 @@ var ts;
function tryGetAnyFileFromPath(host, path) {
// We check all js, `node` and `json` extensions in addition to TS, since node module resolution would also choose those over the directory
var extensions = ts.getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { extension: "json", isMixedContent: false, scriptKind: 6 /* JSON */ }]);
- for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) {
- var e = extensions_1[_i];
+ for (var _i = 0, extensions_3 = extensions; _i < extensions_3.length; _i++) {
+ var e = extensions_3[_i];
var fullPath = path + e;
if (host.fileExists(fullPath)) { // TODO: GH#18217
return fullPath;
@@ -85398,7 +85401,6 @@ var ts;
getKeys: getKeys
};
}
- ts.createDependencyMapper = createDependencyMapper;
function getOutputDeclarationFileName(inputFileName, configFile) {
var relativePath = ts.getRelativePathFromDirectory(rootDirOfOptions(configFile.options, configFile.options.configFilePath), inputFileName, /*ignoreCase*/ true);
var outputPath = ts.resolvePath(configFile.options.declarationDir || configFile.options.outDir || ts.getDirectoryPath(configFile.options.configFilePath), relativePath);
@@ -85524,8 +85526,8 @@ var ts;
var clean = false;
var watch = false;
var projects = [];
- for (var _i = 0, args_3 = args; _i < args_3.length; _i++) {
- var arg = args_3[_i];
+ for (var _i = 0, args_6 = args; _i < args_6.length; _i++) {
+ var arg = args_6[_i];
switch (arg.toLowerCase()) {
case "-v":
case "--verbose":
@@ -85549,23 +85551,28 @@ var ts;
case "--?":
case "-?":
case "--help":
- return ts.printHelp(buildOpts, "--build ");
+ ts.printHelp(buildOpts, "--build ");
+ return ts.ExitStatus.Success;
}
// Not a flag, parse as filename
addProject(arg);
}
// Nonsensical combinations
if (clean && force) {
- return buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force");
+ buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force");
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (clean && verbose) {
- return buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "verbose");
+ buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "verbose");
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (clean && watch) {
- return buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "watch");
+ buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "watch");
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (watch && dry) {
- return buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry");
+ buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry");
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (projects.length === 0) {
// tsc -b invoked with no extra arguments; act as if invoked with "tsc -b ."
@@ -85573,14 +85580,13 @@ var ts;
}
var builder = createSolutionBuilder(compilerHost, buildHost, projects, { dry: dry, force: force, verbose: verbose }, system);
if (clean) {
- builder.cleanAllProjects();
- }
- else {
- builder.buildAllProjects();
+ return builder.cleanAllProjects();
}
if (watch) {
- return builder.startWatching();
+ builder.startWatching();
+ return undefined;
}
+ return builder.buildAllProjects();
function addProject(projectSpecification) {
var fileName = ts.resolvePath(compilerHost.getCurrentDirectory(), projectSpecification);
var refPath = ts.resolveProjectReferencePath(compilerHost, { path: fileName });
@@ -85628,7 +85634,7 @@ var ts;
// Everything is broken - we don't even know what to watch. Give up.
return;
}
- var _loop_9 = function (resolved) {
+ var _loop_12 = function (resolved) {
var cfg = configFileCache.parseConfigFile(resolved);
if (cfg) {
// Watch this file
@@ -85655,7 +85661,7 @@ var ts;
};
for (var _i = 0, _a = graph.buildQueue; _i < _a.length; _i++) {
var resolved = _a[_i];
- _loop_9(resolved);
+ _loop_12(resolved);
}
function invalidateProjectAndScheduleBuilds(resolved) {
invalidateProject(resolved);
@@ -85836,9 +85842,11 @@ var ts;
}
}
var pseudoUpToDate = false;
+ var usesPrepend = false;
if (project.projectReferences) {
for (var _c = 0, _d = project.projectReferences; _c < _d.length; _c++) {
var ref = _d[_c];
+ usesPrepend = usesPrepend || !!(ref.prepend);
var resolvedRef = ts.resolveProjectReferencePath(compilerHost, ref);
var refStatus = getUpToDateStatus(configFileCache.parseConfigFile(resolvedRef));
// An upstream project is blocked
@@ -85888,6 +85896,9 @@ var ts;
newerInputFileName: newestInputFileName
};
}
+ if (usesPrepend) {
+ pseudoUpToDate = false;
+ }
// Up to date
return {
type: pseudoUpToDate ? UpToDateStatusType.UpToDateWithUpstreamTypes : UpToDateStatusType.UpToDate,
@@ -86091,14 +86102,17 @@ var ts;
function cleanAllProjects() {
var resolvedNames = getAllProjectsInScope();
if (resolvedNames === undefined) {
- return buildHost.message(ts.Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
+ buildHost.message(ts.Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
var filesToDelete = getFilesToClean(resolvedNames);
if (filesToDelete === undefined) {
- return buildHost.message(ts.Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
+ buildHost.message(ts.Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (context.options.dry) {
- return buildHost.message(ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+ buildHost.message(ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+ return ts.ExitStatus.Success;
}
// Do this check later to allow --clean --dry to function even if the host can't delete files
if (!compilerHost.deleteFile) {
@@ -86108,6 +86122,7 @@ var ts;
var output = filesToDelete_1[_i];
compilerHost.deleteFile(output);
}
+ return ts.ExitStatus.Success;
}
function resolveProjectName(name) {
var fullPath = ts.resolvePath(compilerHost.getCurrentDirectory(), name);
@@ -86136,13 +86151,15 @@ var ts;
function buildAllProjects() {
var graph = getGlobalDependencyGraph();
if (graph === undefined)
- return;
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
var queue = graph.buildQueue;
reportBuildQueue(graph);
+ var anyFailed = false;
for (var _i = 0, queue_1 = queue; _i < queue_1.length; _i++) {
var next = queue_1[_i];
var proj = configFileCache.parseConfigFile(next);
if (proj === undefined) {
+ anyFailed = true;
break;
}
var status = getUpToDateStatus(proj);
@@ -86170,8 +86187,10 @@ var ts;
// Do nothing
continue;
}
- buildSingleProject(next);
+ var buildResult = buildSingleProject(next);
+ anyFailed = anyFailed || !!(buildResult & BuildResultFlags.AnyErrors);
}
+ return anyFailed ? ts.ExitStatus.DiagnosticsPresent_OutputsSkipped : ts.ExitStatus.Success;
}
/**
* Report the build ordering inferred from the current project graph if we're in verbose mode
@@ -86283,7 +86302,14 @@ var ts;
message: report,
errorDiagnostic: function (d) { return reportDiag_1(d); }
};
- return ts.performBuild(args.slice(1), ts.createCompilerHost({}), buildHost, ts.sys);
+ var result = ts.performBuild(args.slice(1), ts.createCompilerHost({}), buildHost, ts.sys);
+ // undefined = in watch mode, do not exit
+ if (result !== undefined) {
+ return ts.sys.exit(result);
+ }
+ else {
+ return;
+ }
}
var commandLine = ts.parseCommandLine(args);
if (commandLine.options.build) {
diff --git a/lib/tsserver.js b/lib/tsserver.js
index e5585f845b6..47de11d43fd 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -13,6 +13,7 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
@@ -33,99 +34,18 @@ var __assign = (this && this.__assign) || Object.assign || function(t) {
return t;
};
"use strict";
-/*@internal*/
-var ts;
-(function (ts) {
- /** Gets a timestamp with (at least) ms resolution */
- ts.timestamp = typeof performance !== "undefined" && performance.now ? function () { return performance.now(); } : Date.now ? Date.now : function () { return +(new Date()); };
-})(ts || (ts = {}));
-/*@internal*/
-/** Performance measurements for the compiler. */
-(function (ts) {
- var performance;
- (function (performance) {
- // NOTE: cannot use ts.noop as core.ts loads after this
- var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : function () { };
- var enabled = false;
- var profilerStart = 0;
- var counts;
- var marks;
- var measures;
- /**
- * Marks a performance event.
- *
- * @param markName The name of the mark.
- */
- function mark(markName) {
- if (enabled) {
- marks.set(markName, ts.timestamp());
- counts.set(markName, (counts.get(markName) || 0) + 1);
- profilerEvent(markName);
- }
- }
- performance.mark = mark;
- /**
- * Adds a performance measurement with the specified name.
- *
- * @param measureName The name of the performance measurement.
- * @param startMarkName The name of the starting mark. If not supplied, the point at which the
- * profiler was enabled is used.
- * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is
- * used.
- */
- function measure(measureName, startMarkName, endMarkName) {
- if (enabled) {
- var end = endMarkName && marks.get(endMarkName) || ts.timestamp();
- var start = startMarkName && marks.get(startMarkName) || profilerStart;
- measures.set(measureName, (measures.get(measureName) || 0) + (end - start));
- }
- }
- performance.measure = measure;
- /**
- * Gets the number of times a marker was encountered.
- *
- * @param markName The name of the mark.
- */
- function getCount(markName) {
- return counts && counts.get(markName) || 0;
- }
- performance.getCount = getCount;
- /**
- * Gets the total duration of all measurements with the supplied name.
- *
- * @param measureName The name of the measure whose durations should be accumulated.
- */
- function getDuration(measureName) {
- return measures && measures.get(measureName) || 0;
- }
- performance.getDuration = getDuration;
- /**
- * Iterate over each measure, performing some action
- *
- * @param cb The action to perform for each measure
- */
- function forEachMeasure(cb) {
- measures.forEach(function (measure, key) {
- cb(key, measure);
- });
- }
- performance.forEachMeasure = forEachMeasure;
- /** Enables (and resets) performance measurements for the compiler. */
- function enable() {
- counts = ts.createMap();
- marks = ts.createMap();
- measures = ts.createMap();
- enabled = true;
- profilerStart = ts.timestamp();
- }
- performance.enable = enable;
- /** Disables performance measurements for the compiler. */
- function disable() {
- enabled = false;
- }
- performance.disable = disable;
- })(performance = ts.performance || (ts.performance = {}));
-})(ts || (ts = {}));
+var __assign = (this && this.__assign) || Object.assign || function(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
+ t[p] = s[p];
+ }
+ return t;
+};
+var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
+ return cooked;
+};
var ts;
(function (ts) {
// WARNING: The script `configureNightly.ts` uses a regexp to parse out these values.
@@ -134,14 +54,17 @@ var ts;
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".0-dev";
})(ts || (ts = {}));
-/* @internal */
(function (ts) {
+ /* @internal */
var Comparison;
(function (Comparison) {
Comparison[Comparison["LessThan"] = -1] = "LessThan";
Comparison[Comparison["EqualTo"] = 0] = "EqualTo";
Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan";
})(Comparison = ts.Comparison || (ts.Comparison = {}));
+})(ts || (ts = {}));
+/* @internal */
+(function (ts) {
/** Create a MapLike with good performance. */
function createDictionaryObject() {
var map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword
@@ -2003,16 +1926,99 @@ var ts;
}
ts.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes;
})(ts || (ts = {}));
-//# sourceMappingURL=core.js.map
-"use strict";
-var __assign = (this && this.__assign) || Object.assign || function(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
-};
+/*@internal*/
+var ts;
+(function (ts) {
+ /** Gets a timestamp with (at least) ms resolution */
+ ts.timestamp = typeof performance !== "undefined" && performance.now ? function () { return performance.now(); } : Date.now ? Date.now : function () { return +(new Date()); };
+})(ts || (ts = {}));
+/*@internal*/
+/** Performance measurements for the compiler. */
+(function (ts) {
+ var performance;
+ (function (performance) {
+ // NOTE: cannot use ts.noop as core.ts loads after this
+ var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : function () { };
+ var enabled = false;
+ var profilerStart = 0;
+ var counts;
+ var marks;
+ var measures;
+ /**
+ * Marks a performance event.
+ *
+ * @param markName The name of the mark.
+ */
+ function mark(markName) {
+ if (enabled) {
+ marks.set(markName, ts.timestamp());
+ counts.set(markName, (counts.get(markName) || 0) + 1);
+ profilerEvent(markName);
+ }
+ }
+ performance.mark = mark;
+ /**
+ * Adds a performance measurement with the specified name.
+ *
+ * @param measureName The name of the performance measurement.
+ * @param startMarkName The name of the starting mark. If not supplied, the point at which the
+ * profiler was enabled is used.
+ * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is
+ * used.
+ */
+ function measure(measureName, startMarkName, endMarkName) {
+ if (enabled) {
+ var end = endMarkName && marks.get(endMarkName) || ts.timestamp();
+ var start = startMarkName && marks.get(startMarkName) || profilerStart;
+ measures.set(measureName, (measures.get(measureName) || 0) + (end - start));
+ }
+ }
+ performance.measure = measure;
+ /**
+ * Gets the number of times a marker was encountered.
+ *
+ * @param markName The name of the mark.
+ */
+ function getCount(markName) {
+ return counts && counts.get(markName) || 0;
+ }
+ performance.getCount = getCount;
+ /**
+ * Gets the total duration of all measurements with the supplied name.
+ *
+ * @param measureName The name of the measure whose durations should be accumulated.
+ */
+ function getDuration(measureName) {
+ return measures && measures.get(measureName) || 0;
+ }
+ performance.getDuration = getDuration;
+ /**
+ * Iterate over each measure, performing some action
+ *
+ * @param cb The action to perform for each measure
+ */
+ function forEachMeasure(cb) {
+ measures.forEach(function (measure, key) {
+ cb(key, measure);
+ });
+ }
+ performance.forEachMeasure = forEachMeasure;
+ /** Enables (and resets) performance measurements for the compiler. */
+ function enable() {
+ counts = ts.createMap();
+ marks = ts.createMap();
+ measures = ts.createMap();
+ enabled = true;
+ profilerStart = ts.timestamp();
+ }
+ performance.enable = enable;
+ /** Disables performance measurements for the compiler. */
+ function disable() {
+ enabled = false;
+ }
+ performance.disable = disable;
+ })(performance = ts.performance || (ts.performance = {}));
+})(ts || (ts = {}));
var ts;
(function (ts) {
// token > SyntaxKind.Identifier => token is a keyword
@@ -4289,8 +4295,8 @@ var ts;
var entries = _fs.readdirSync(path || ".").sort();
var files = [];
var directories = [];
- for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
- var entry = entries_1[_i];
+ for (var _i = 0, entries_2 = entries; _i < entries_2.length; _i++) {
+ var entry = entries_2[_i];
// This is necessary because on some file system node fails to exclude
// "." and "..". See https://github.com/nodejs/node/issues/4002
if (entry === "." || entry === "..") {
@@ -4470,7 +4476,7 @@ var ts;
}
})(ts || (ts = {}));
//
-// generated from './diagnosticInformationMap.generated.ts' by 'src\parser'
+// generated from './diagnosticInformationMap.generated.ts' by 'src\compiler'
/* @internal */
var ts;
(function (ts) {
@@ -7464,11 +7470,6 @@ var ts;
/** Non-internal stuff goes here */
var ts;
(function (ts) {
- ts.emptyArray = [];
- function closeFileWatcher(watcher) {
- watcher.close();
- }
- ts.closeFileWatcher = closeFileWatcher;
function isExternalModuleNameRelative(moduleName) {
// TypeScript 1.0 spec (April 2014): 11.2.1
// An external module name is "relative" if the first term is "." or "..".
@@ -7480,20 +7481,10 @@ var ts;
return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics);
}
ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics;
- function toPath(fileName, basePath, getCanonicalFileName) {
- var nonCanonicalizedPath = ts.isRootedDiskPath(fileName)
- ? ts.normalizePath(fileName)
- : ts.getNormalizedAbsolutePath(fileName, basePath);
- return getCanonicalFileName(nonCanonicalizedPath);
- }
- ts.toPath = toPath;
- function hasEntries(map) {
- return !!map && !!map.size;
- }
- ts.hasEntries = hasEntries;
})(ts || (ts = {}));
/* @internal */
(function (ts) {
+ ts.emptyArray = [];
ts.resolvingEmptyArray = [];
ts.emptyMap = ts.createMap();
ts.emptyUnderscoreEscapedMap = ts.emptyMap;
@@ -7516,6 +7507,10 @@ var ts;
return new ts.MapCtr();
}
ts.createUnderscoreEscapedMap = createUnderscoreEscapedMap;
+ function hasEntries(map) {
+ return !!map && !!map.size;
+ }
+ ts.hasEntries = hasEntries;
function createSymbolTable(symbols) {
var result = ts.createMap();
if (symbols) {
@@ -7562,6 +7557,13 @@ var ts;
reportPrivateInBaseOfClassExpression: ts.noop,
};
}
+ function toPath(fileName, basePath, getCanonicalFileName) {
+ var nonCanonicalizedPath = ts.isRootedDiskPath(fileName)
+ ? ts.normalizePath(fileName)
+ : ts.getNormalizedAbsolutePath(fileName, basePath);
+ return getCanonicalFileName(nonCanonicalizedPath);
+ }
+ ts.toPath = toPath;
function changesAffectModuleResolution(oldOptions, newOptions) {
return !oldOptions ||
(oldOptions.module !== newOptions.module) ||
@@ -10391,7 +10393,7 @@ var ts;
*/
function getExternalModuleNameFromPath(host, fileName, referencePath) {
var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); };
- var dir = ts.toPath(referencePath ? ts.getDirectoryPath(referencePath) : host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName);
+ var dir = toPath(referencePath ? ts.getDirectoryPath(referencePath) : host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName);
var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory());
var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
var extensionless = ts.removeFileExtension(relativePath);
@@ -11299,6 +11301,10 @@ var ts;
return options.watch && options.hasOwnProperty("watch");
}
ts.isWatchSet = isWatchSet;
+ function closeFileWatcher(watcher) {
+ watcher.close();
+ }
+ ts.closeFileWatcher = closeFileWatcher;
function getCheckFlags(symbol) {
return symbol.flags & 33554432 /* Transient */ ? symbol.checkFlags : 0;
}
@@ -13721,6 +13727,9 @@ var ts;
return node.kind === 9 /* StringLiteral */ || node.kind === 13 /* NoSubstitutionTemplateLiteral */;
}
ts.isStringLiteralLike = isStringLiteralLike;
+})(ts || (ts = {}));
+/* @internal */
+(function (ts) {
/** @internal */
function isNamedImportsOrExports(node) {
return node.kind === 247 /* NamedImports */ || node.kind === 251 /* NamedExports */;
@@ -13737,7 +13746,7 @@ var ts;
}
function Type(checker, flags) {
this.flags = flags;
- if (Debug.isDebugging) {
+ if (ts.Debug.isDebugging) {
this.checker = checker;
}
}
@@ -13768,9 +13777,10 @@ var ts;
getSignatureConstructor: function () { return Signature; },
getSourceMapSourceConstructor: function () { return SourceMapSource; },
};
+ /* @internal */
function formatStringFromArgs(text, args, baseIndex) {
if (baseIndex === void 0) { baseIndex = 0; }
- return text.replace(/{(\d+)}/g, function (_match, index) { return Debug.assertDefined(args[+index + baseIndex]); });
+ return text.replace(/{(\d+)}/g, function (_match, index) { return ts.Debug.assertDefined(args[+index + baseIndex]); });
}
ts.formatStringFromArgs = formatStringFromArgs;
function getLocaleSpecificMessage(message) {
@@ -13778,11 +13788,11 @@ var ts;
}
ts.getLocaleSpecificMessage = getLocaleSpecificMessage;
function createFileDiagnostic(file, start, length, message) {
- Debug.assertGreaterThanOrEqual(start, 0);
- Debug.assertGreaterThanOrEqual(length, 0);
+ ts.Debug.assertGreaterThanOrEqual(start, 0);
+ ts.Debug.assertGreaterThanOrEqual(length, 0);
if (file) {
- Debug.assertLessThanOrEqual(start, file.text.length);
- Debug.assertLessThanOrEqual(start + length, file.text.length);
+ ts.Debug.assertLessThanOrEqual(start, file.text.length);
+ ts.Debug.assertLessThanOrEqual(start + length, file.text.length);
}
var text = getLocaleSpecificMessage(message);
if (arguments.length > 4) {
@@ -13824,6 +13834,7 @@ var ts;
};
}
ts.createCompilerDiagnostic = createCompilerDiagnostic;
+ /* @internal */
function createCompilerDiagnosticFromMessageChain(chain) {
return {
file: undefined,
@@ -13860,6 +13871,7 @@ var ts;
function getDiagnosticFilePath(diagnostic) {
return diagnostic.file ? diagnostic.file.path : undefined;
}
+ /* @internal */
function compareDiagnostics(d1, d2) {
return ts.compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d2)) ||
ts.compareValues(d1.start, d2.start) ||
@@ -14074,7 +14086,7 @@ var ts;
ts.getRootLength = getRootLength;
// TODO(rbuckton): replace references with `resolvePath`
function normalizePath(path) {
- return resolvePath(path);
+ return ts.resolvePath(path);
}
ts.normalizePath = normalizePath;
function normalizePathAndParts(path) {
@@ -14082,7 +14094,7 @@ var ts;
var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1);
if (parts.length) {
var joinedParts = root + parts.join(ts.directorySeparator);
- return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts };
+ return { path: ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts };
}
else {
return { path: root, parts: parts };
@@ -14097,7 +14109,7 @@ var ts;
return path;
// return the leading portion of the path up to the last (non-terminal) directory separator
// but not including any trailing directory separator.
- path = removeTrailingDirectorySeparator(path);
+ path = ts.removeTrailingDirectorySeparator(path);
return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator)));
}
ts.getDirectoryPath = getDirectoryPath;
@@ -14125,10 +14137,11 @@ var ts;
return rootLength > 0 && rootLength === path.length;
}
ts.isDiskPathRoot = isDiskPathRoot;
+ /* @internal */
function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) {
return !isRootedDiskPath(absoluteOrRelativePath)
? absoluteOrRelativePath
- : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
+ : ts.getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
}
ts.convertToRelativePath = convertToRelativePath;
function pathComponents(path, rootLength) {
@@ -14146,7 +14159,7 @@ var ts;
*/
function getPathComponents(path, currentDirectory) {
if (currentDirectory === void 0) { currentDirectory = ""; }
- path = combinePaths(currentDirectory, path);
+ path = ts.combinePaths(currentDirectory, path);
var rootLength = getRootLength(path);
return pathComponents(path, rootLength);
}
@@ -14201,15 +14214,18 @@ var ts;
function getPathFromPathComponents(pathComponents) {
if (pathComponents.length === 0)
return "";
- var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]);
+ var root = pathComponents[0] && ts.ensureTrailingDirectorySeparator(pathComponents[0]);
if (pathComponents.length === 1)
return root;
return root + pathComponents.slice(1).join(ts.directorySeparator);
}
ts.getPathFromPathComponents = getPathFromPathComponents;
+})(ts || (ts = {}));
+/* @internal */
+(function (ts) {
function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) {
- var fromComponents = reducePathComponents(getPathComponents(from));
- var toComponents = reducePathComponents(getPathComponents(to));
+ var fromComponents = ts.reducePathComponents(ts.getPathComponents(from));
+ var toComponents = ts.reducePathComponents(ts.getPathComponents(to));
var start;
for (start = 0; start < fromComponents.length && start < toComponents.length; start++) {
var fromComponent = getCanonicalFileName(fromComponents[start]);
@@ -14228,26 +14244,27 @@ var ts;
}
return [""].concat(relative, components);
}
+ ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
function getRelativePathFromFile(from, to, getCanonicalFileName) {
- return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName));
+ return ensurePathIsNonModuleName(getRelativePathFromDirectory(ts.getDirectoryPath(from), to, getCanonicalFileName));
}
ts.getRelativePathFromFile = getRelativePathFromFile;
function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
- Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative");
+ Debug.assert((ts.getRootLength(fromDirectory) > 0) === (ts.getRootLength(to) > 0), "Paths must either both be absolute or both be relative");
var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity;
var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false;
var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName);
- return getPathFromPathComponents(pathComponents);
+ return ts.getPathFromPathComponents(pathComponents);
}
ts.getRelativePathFromDirectory = getRelativePathFromDirectory;
function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) {
var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName);
var firstComponent = pathComponents[0];
- if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) {
+ if (isAbsolutePathAnUrl && ts.isRootedDiskPath(firstComponent)) {
var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///";
pathComponents[0] = prefix + firstComponent;
}
- return getPathFromPathComponents(pathComponents);
+ return ts.getPathFromPathComponents(pathComponents);
}
ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl;
/**
@@ -14255,19 +14272,19 @@ var ts;
* with `./` or `../`) so as not to be confused with an unprefixed module name.
*/
function ensurePathIsNonModuleName(path) {
- return getRootLength(path) === 0 && !pathIsRelative(path) ? "./" + path : path;
+ return ts.getRootLength(path) === 0 && !ts.pathIsRelative(path) ? "./" + path : path;
}
ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName;
function getBaseFileName(path, extensions, ignoreCase) {
- path = normalizeSlashes(path);
+ path = ts.normalizeSlashes(path);
// if the path provided is itself the root, then it has not file name.
- var rootLength = getRootLength(path);
+ var rootLength = ts.getRootLength(path);
if (rootLength === path.length)
return "";
// return the trailing portion of the path starting after the last (non-terminal) directory
// separator but not including any trailing directory separator.
path = removeTrailingDirectorySeparator(path);
- var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1));
+ var name = path.slice(Math.max(ts.getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1));
var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined;
return extension ? name.slice(0, name.length - extension.length) : name;
}
@@ -14281,13 +14298,13 @@ var ts;
paths[_i - 1] = arguments[_i];
}
if (path)
- path = normalizeSlashes(path);
+ path = ts.normalizeSlashes(path);
for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) {
var relativePath = paths_1[_a];
if (!relativePath)
continue;
- relativePath = normalizeSlashes(relativePath);
- if (!path || getRootLength(relativePath) !== 0) {
+ relativePath = ts.normalizeSlashes(relativePath);
+ if (!path || ts.getRootLength(relativePath) !== 0) {
path = relativePath;
}
else {
@@ -14306,8 +14323,8 @@ var ts;
for (var _i = 1; _i < arguments.length; _i++) {
paths[_i - 1] = arguments[_i];
}
- var combined = ts.some(paths) ? combinePaths.apply(void 0, [path].concat(paths)) : normalizeSlashes(path);
- var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(combined)));
+ var combined = ts.some(paths) ? combinePaths.apply(void 0, [path].concat(paths)) : ts.normalizeSlashes(path);
+ var normalized = ts.getPathFromPathComponents(ts.reducePathComponents(ts.getPathComponents(combined)));
return normalized && hasTrailingDirectorySeparator(combined) ? ensureTrailingDirectorySeparator(normalized) : normalized;
}
ts.resolvePath = resolvePath;
@@ -14342,8 +14359,8 @@ var ts;
return -1 /* LessThan */;
if (b === undefined)
return 1 /* GreaterThan */;
- var aComponents = reducePathComponents(getPathComponents(a));
- var bComponents = reducePathComponents(getPathComponents(b));
+ var aComponents = ts.reducePathComponents(ts.getPathComponents(a));
+ var bComponents = ts.reducePathComponents(ts.getPathComponents(b));
var sharedLength = Math.min(aComponents.length, bComponents.length);
for (var i = 0; i < sharedLength; i++) {
var stringComparer = i === 0 ? ts.compareStringsCaseInsensitive : componentComparer;
@@ -14391,8 +14408,8 @@ var ts;
return false;
if (parent === child)
return true;
- var parentComponents = reducePathComponents(getPathComponents(parent));
- var childComponents = reducePathComponents(getPathComponents(child));
+ var parentComponents = ts.reducePathComponents(ts.getPathComponents(parent));
+ var childComponents = ts.reducePathComponents(ts.getPathComponents(child));
if (childComponents.length < parentComponents.length) {
return false;
}
@@ -14495,7 +14512,7 @@ var ts;
var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter;
var subpattern = "";
var hasWrittenComponent = false;
- var components = getNormalizedPathComponents(spec, basePath);
+ var components = ts.getNormalizedPathComponents(spec, basePath);
var lastComponent = ts.last(components);
if (usage !== "exclude" && lastComponent === "**") {
return undefined;
@@ -14562,8 +14579,8 @@ var ts;
}
/** @param path directory of the tsconfig.json */
function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
- path = normalizePath(path);
- currentDirectory = normalizePath(currentDirectory);
+ path = ts.normalizePath(path);
+ currentDirectory = ts.normalizePath(currentDirectory);
var absolutePath = combinePaths(currentDirectory, path);
return {
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
@@ -14580,8 +14597,8 @@ var ts;
ts.getRegexFromPattern = getRegexFromPattern;
/** @param path directory of the tsconfig.json */
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries) {
- path = normalizePath(path);
- currentDirectory = normalizePath(currentDirectory);
+ path = ts.normalizePath(path);
+ currentDirectory = ts.normalizePath(currentDirectory);
var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return getRegexFromPattern(pattern, useCaseSensitiveFileNames); });
var includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);
@@ -14648,7 +14665,7 @@ var ts;
var include = includes_1[_i];
// We also need to check the relative paths by converting them to absolute and normalizing
// in case they escape the base path (e.g "..\somedirectory")
- var absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include));
+ var absolute = ts.isRootedDiskPath(include) ? include : ts.normalizePath(combinePaths(path, include));
// Append the literal and canonical candidate base paths.
includeBasePaths.push(getIncludeBasePath(absolute));
}
@@ -14674,7 +14691,7 @@ var ts;
// No "*" or "?" in the path
return !hasExtension(absolute)
? absolute
- : removeTrailingDirectorySeparator(getDirectoryPath(absolute));
+ : removeTrailingDirectorySeparator(ts.getDirectoryPath(absolute));
}
return absolute.substring(0, absolute.lastIndexOf(ts.directorySeparator, wildcardOffset));
}
@@ -14851,7 +14868,7 @@ var ts;
})(Debug = ts.Debug || (ts.Debug = {}));
function tryParsePattern(pattern) {
// This should be verified outside of here and a proper error thrown.
- Debug.assert(hasZeroOrOneAsteriskCharacter(pattern));
+ Debug.assert(ts.hasZeroOrOneAsteriskCharacter(pattern));
var indexOfStar = pattern.indexOf("*");
return indexOfStar === -1 ? undefined : {
prefix: pattern.substr(0, indexOfStar),
@@ -14894,8 +14911,8 @@ var ts;
function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) {
if (typeof extensions === "string")
extensions = [extensions];
- for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) {
- var extension = extensions_1[_i];
+ for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) {
+ var extension = extensions_2[_i];
if (!ts.startsWith(extension, "."))
extension = "." + extension;
if (path.length >= extension.length && path.charAt(path.length - extension.length) === ".") {
@@ -21368,8 +21385,8 @@ var ts;
array._children = undefined;
array.pos += delta;
array.end += delta;
- for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {
- var node = array_1[_i];
+ for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
+ var node = array_8[_i];
visitNode(node);
}
}
@@ -21519,8 +21536,8 @@ var ts;
array._children = undefined;
// Adjust the pos or end (or both) of the intersecting array accordingly.
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
- for (var _i = 0, array_2 = array; _i < array_2.length; _i++) {
- var node = array_2[_i];
+ for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
+ var node = array_9[_i];
visitNode(node);
}
return;
@@ -25356,20 +25373,6 @@ var ts;
return value !== undefined ? { value: value } : undefined;
}
})(ts || (ts = {}));
-//# sourceMappingURL=parser.js.map
-"use strict";
-var __assign = (this && this.__assign) || Object.assign || function(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
-};
-var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
- return cooked;
-};
/* @internal */
var ts;
(function (ts) {
@@ -25930,8 +25933,8 @@ var ts;
var savedSubtreeTransformFlags = subtreeTransformFlags;
subtreeTransformFlags = 0 /* None */;
var nodeArrayFlags = 0 /* None */;
- for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
- var node = nodes_1[_i];
+ for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) {
+ var node = nodes_2[_i];
bindFunction(node);
nodeArrayFlags |= node.transformFlags & ~536870912 /* HasComputedFlags */;
}
@@ -31322,8 +31325,8 @@ var ts;
}
function findConstructorDeclaration(node) {
var members = node.members;
- for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {
- var member = members_1[_i];
+ for (var _i = 0, members_2 = members; _i < members_2.length; _i++) {
+ var member = members_2[_i];
if (member.kind === 155 /* Constructor */ && ts.nodeIsPresent(member.body)) {
return member;
}
@@ -33229,7 +33232,7 @@ var ts;
var definedInConstructor = false;
var definedInMethod = false;
var jsDocType;
- var _loop_1 = function (declaration) {
+ var _loop_4 = function (declaration) {
var declarationInConstructor = false;
var expression = declaration.kind === 200 /* BinaryExpression */ ? declaration :
declaration.kind === 185 /* PropertyAccessExpression */ ? ts.cast(declaration.parent, ts.isBinaryExpression) :
@@ -33272,20 +33275,20 @@ var ts;
special === 2 /* ModuleExports */ &&
symbol.escapedName === "export=" /* ExportEquals */) {
var exportedType_1 = resolveStructuredTypeMembers(type_2);
- var members_2 = ts.createSymbolTable();
- ts.copyEntries(exportedType_1.members, members_2);
+ var members_3 = ts.createSymbolTable();
+ ts.copyEntries(exportedType_1.members, members_3);
symbol.exports.forEach(function (s, name) {
- if (members_2.has(name)) {
+ if (members_3.has(name)) {
var exportedMember = exportedType_1.members.get(name);
var union = createSymbol(s.flags | exportedMember.flags, name);
union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
- members_2.set(name, union);
+ members_3.set(name, union);
}
else {
- members_2.set(name, s);
+ members_3.set(name, s);
}
});
- type_2 = createAnonymousType(exportedType_1.symbol, members_2, exportedType_1.callSignatures, exportedType_1.constructSignatures, exportedType_1.stringIndexInfo, exportedType_1.numberIndexInfo);
+ type_2 = createAnonymousType(exportedType_1.symbol, members_3, exportedType_1.callSignatures, exportedType_1.constructSignatures, exportedType_1.stringIndexInfo, exportedType_1.numberIndexInfo);
}
var anyedType = type_2;
if (isEmptyArrayLiteralType(type_2)) {
@@ -33302,7 +33305,7 @@ var ts;
};
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- var state_2 = _loop_1(declaration);
+ var state_2 = _loop_4(declaration);
if (typeof state_2 === "object")
return state_2.value;
}
@@ -33771,8 +33774,8 @@ var ts;
// The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set
// in-place and returns the same array.
function appendTypeParameters(typeParameters, declarations) {
- for (var _i = 0, declarations_1 = declarations; _i < declarations_1.length; _i++) {
- var declaration = declarations_1[_i];
+ for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) {
+ var declaration = declarations_2[_i];
typeParameters = ts.appendIfUnique(typeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)));
}
return typeParameters;
@@ -34350,8 +34353,8 @@ var ts;
// we check symbols to see if we can quickly conclude they are free of "this" references, thus needing no instantiation.
function createInstantiatedSymbolTable(symbols, mapper, mappingThisOnly) {
var result = ts.createSymbolTable();
- for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) {
- var symbol = symbols_1[_i];
+ for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) {
+ var symbol = symbols_2[_i];
result.set(symbol.escapedName, mappingThisOnly && isThisless(symbol) ? symbol : instantiateSymbol(symbol, mapper));
}
return result;
@@ -34501,9 +34504,9 @@ var ts;
// If we have an existing early-bound member, combine its declarations so that we can
// report an error at each declaration.
var declarations = earlySymbol ? ts.concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
- var name_1 = ts.declarationNameToString(decl.name);
- ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Duplicate_declaration_0, name_1); });
- error(decl.name || decl, ts.Diagnostics.Duplicate_declaration_0, name_1);
+ var name_2 = ts.declarationNameToString(decl.name);
+ ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Duplicate_declaration_0, name_2); });
+ error(decl.name || decl, ts.Diagnostics.Duplicate_declaration_0, name_2);
lateSymbol = createSymbol(0 /* None */, memberName, 1024 /* Late */);
}
lateSymbol.nameType = type;
@@ -34536,8 +34539,8 @@ var ts;
var decl = _a[_i];
var members = ts.getMembersOfDeclaration(decl);
if (members) {
- for (var _b = 0, members_3 = members; _b < members_3.length; _b++) {
- var member = members_3[_b];
+ for (var _b = 0, members_4 = members; _b < members_4.length; _b++) {
+ var member = members_4[_b];
if (isStatic === ts.hasStaticModifier(member) && hasLateBindableName(member)) {
lateBindMember(symbol, earlySymbols, lateSymbols, member);
}
@@ -34813,7 +34816,7 @@ var ts;
var numberIndexInfo;
var types = type.types;
var mixinCount = ts.countWhere(types, isMixinConstructorType);
- var _loop_2 = function (i) {
+ var _loop_5 = function (i) {
var t = type.types[i];
// When an intersection type contains mixin constructor types, the construct signatures from
// those types are discarded and their return types are mixed into the return types of all
@@ -34836,7 +34839,7 @@ var ts;
numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1 /* Number */));
};
for (var i = 0; i < types.length; i++) {
- _loop_2(i);
+ _loop_5(i);
}
setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
}
@@ -36416,8 +36419,8 @@ var ts;
function getTypeOfGlobalSymbol(symbol, arity) {
function getTypeDeclaration(symbol) {
var declarations = symbol.declarations;
- for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) {
- var declaration = declarations_2[_i];
+ for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
+ var declaration = declarations_3[_i];
switch (declaration.kind) {
case 235 /* ClassDeclaration */:
case 236 /* InterfaceDeclaration */:
@@ -36878,7 +36881,7 @@ var ts;
var unionType = types[unionIndex];
var intersection = unionType.types;
var i = types.length - 1;
- var _loop_3 = function () {
+ var _loop_6 = function () {
var t = types[i];
if (t.flags & 67108864 /* UnionOfUnitTypes */) {
intersection = ts.filter(intersection, function (u) { return containsType(t.types, u); });
@@ -36887,7 +36890,7 @@ var ts;
i--;
};
while (i > unionIndex) {
- _loop_3();
+ _loop_6();
}
if (intersection === unionType.types) {
return false;
@@ -38834,7 +38837,7 @@ var ts;
// check excess properties against discriminant type only, not the entire union
return hasExcessProperties(source, discriminant, /*discriminant*/ undefined, reportErrors);
}
- var _loop_4 = function (prop) {
+ var _loop_7 = function (prop) {
if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) {
if (reportErrors) {
// We know *exactly* where things went wrong when comparing the types.
@@ -38873,7 +38876,7 @@ var ts;
};
for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) {
var prop = _a[_i];
- var state_3 = _loop_4(prop);
+ var state_3 = _loop_7(prop);
if (typeof state_3 === "object")
return state_3.value;
}
@@ -39319,10 +39322,10 @@ var ts;
var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
if (modifiersRelated) {
- var result_1;
- if (result_1 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) {
+ var result_2;
+ if (result_2 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) {
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
- return result_1 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors);
+ return result_2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors);
}
}
return 0 /* False */;
@@ -44649,7 +44652,7 @@ var ts;
// Assignability failure - check each prop individually, and if that fails, fall back on the bad error span
if (ts.length(openingLikeElement.attributes.properties)) {
var reportedError = false;
- var _loop_5 = function (prop) {
+ var _loop_8 = function (prop) {
if (ts.isJsxSpreadAttribute(prop))
return "continue";
var name = ts.idText(prop.name);
@@ -44663,7 +44666,7 @@ var ts;
};
for (var _b = 0, _c = openingLikeElement.attributes.properties; _b < _c.length; _b++) {
var prop = _c[_b];
- _loop_5(prop);
+ _loop_8(prop);
}
if (reportedError) {
return;
@@ -45596,13 +45599,13 @@ var ts;
function getEffectiveCallArguments(node) {
if (node.kind === 189 /* TaggedTemplateExpression */) {
var template = node.template;
- var args_1 = [undefined]; // TODO: GH#18217
+ var args_4 = [undefined]; // TODO: GH#18217
if (template.kind === 202 /* TemplateExpression */) {
ts.forEach(template.templateSpans, function (span) {
- args_1.push(span.expression);
+ args_4.push(span.expression);
});
}
- return args_1;
+ return args_4;
}
else if (node.kind === 150 /* Decorator */) {
// For a decorator, we return undefined as we will determine
@@ -49014,8 +49017,8 @@ var ts;
}
var duplicateFunctionDeclaration = false;
var multipleConstructorImplementation = false;
- for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
- var current = declarations_3[_i];
+ for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
+ var current = declarations_4[_i];
var node = current;
var inAmbientContext = node.flags & 4194304 /* Ambient */;
var inAmbientContextOrInterface = node.parent.kind === 236 /* InterfaceDeclaration */ || node.parent.kind === 166 /* TypeLiteral */ || inAmbientContext;
@@ -49184,10 +49187,10 @@ var ts;
case 243 /* ImportEqualsDeclaration */:
case 246 /* NamespaceImport */:
case 245 /* ImportClause */:
- var result_2 = 0 /* None */;
+ var result_3 = 0 /* None */;
var target = resolveAlias(getSymbolOfNode(d));
- ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); });
- return result_2;
+ ts.forEach(target.declarations, function (d) { result_3 |= getDeclarationSpaces(d); });
+ return result_3;
case 232 /* VariableDeclaration */:
case 182 /* BindingElement */:
case 234 /* FunctionDeclaration */:
@@ -49984,8 +49987,8 @@ var ts;
: ts.createDiagnosticForNode(declarationList.parent.kind === 214 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
}
else {
- for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
- var decl = declarations_4[_i];
+ for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
+ var decl = declarations_5[_i];
addDiagnostic(0 /* Local */, ts.createDiagnosticForNode(decl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.cast(decl.name, ts.isIdentifier))));
}
}
@@ -51169,8 +51172,8 @@ var ts;
if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) {
// Report an error on every conflicting declaration.
var name = symbolToString(symbol);
- for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
- var declaration = declarations_5[_i];
+ for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
+ var declaration = declarations_6[_i];
error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name);
}
}
@@ -51179,8 +51182,8 @@ var ts;
function areTypeParametersIdentical(declarations, targetParameters) {
var maxTypeArgumentCount = ts.length(targetParameters);
var minTypeArgumentCount = getMinTypeArgumentCount(targetParameters);
- for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
- var declaration = declarations_6[_i];
+ for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
+ var declaration = declarations_7[_i];
// If this declaration has too few or too many type parameters, we report an error
var sourceParameters = ts.getEffectiveTypeParameterDeclarations(declaration);
var numTypeParameters = sourceParameters.length;
@@ -51334,7 +51337,7 @@ var ts;
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
// iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
var issuedMemberError = false;
- var _loop_6 = function (member) {
+ var _loop_9 = function (member) {
if (ts.hasStaticModifier(member)) {
return "continue";
}
@@ -51353,7 +51356,7 @@ var ts;
};
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- _loop_6(member);
+ _loop_9(member);
}
if (!issuedMemberError) {
// check again with diagnostics to generate a less-specific error
@@ -51638,12 +51641,12 @@ var ts;
function evaluate(expr) {
switch (expr.kind) {
case 198 /* PrefixUnaryExpression */:
- var value_1 = evaluate(expr.operand);
- if (typeof value_1 === "number") {
+ var value_2 = evaluate(expr.operand);
+ if (typeof value_2 === "number") {
switch (expr.operator) {
- case 37 /* PlusToken */: return value_1;
- case 38 /* MinusToken */: return -value_1;
- case 52 /* TildeToken */: return ~value_1;
+ case 37 /* PlusToken */: return value_2;
+ case 38 /* MinusToken */: return -value_2;
+ case 52 /* TildeToken */: return ~value_2;
}
}
break;
@@ -51782,8 +51785,8 @@ var ts;
}
function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {
var declarations = symbol.declarations;
- for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
- var declaration = declarations_7[_i];
+ for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
+ var declaration = declarations_8[_i];
if ((declaration.kind === 235 /* ClassDeclaration */ ||
(declaration.kind === 234 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) &&
!(declaration.flags & 4194304 /* Ambient */)) {
@@ -52206,9 +52209,9 @@ var ts;
}
}
// Checks for export * conflicts
- var exports = getExportsOfModule(moduleSymbol);
- if (exports) {
- exports.forEach(function (_a, id) {
+ var exports_1 = getExportsOfModule(moduleSymbol);
+ if (exports_1) {
+ exports_1.forEach(function (_a, id) {
var declarations = _a.declarations, flags = _a.flags;
if (id === "__export") {
return;
@@ -52225,8 +52228,8 @@ var ts;
return;
}
if (exportedDeclarationsCount > 1) {
- for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
- var declaration = declarations_8[_i];
+ for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {
+ var declaration = declarations_9[_i];
if (isNotOverload(declaration)) {
diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id)));
}
@@ -54289,8 +54292,8 @@ var ts;
}
function checkGrammarForOmittedArgument(args) {
if (args) {
- for (var _i = 0, args_2 = args; _i < args_2.length; _i++) {
- var arg = args_2[_i];
+ for (var _i = 0, args_5 = args; _i < args_5.length; _i++) {
+ var arg = args_5[_i];
if (arg.kind === 206 /* OmittedExpression */) {
return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
}
@@ -60261,8 +60264,8 @@ var ts;
}
var subtreeFlags = 0 /* None */;
var nodeArrayFlags = 0 /* None */;
- for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) {
- var node = nodes_2[_i];
+ for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) {
+ var node = nodes_3[_i];
subtreeFlags |= aggregateTransformFlagsForNode(node);
nodeArrayFlags |= node.transformFlags & ~536870912 /* HasComputedFlags */;
}
@@ -62327,8 +62330,8 @@ var ts;
function generateClassElementDecorationExpressions(node, isStatic) {
var members = getDecoratedClassElements(node, isStatic);
var expressions;
- for (var _i = 0, members_4 = members; _i < members_4.length; _i++) {
- var member = members_4[_i];
+ for (var _i = 0, members_5 = members; _i < members_5.length; _i++) {
+ var member = members_5[_i];
var expression = generateClassElementDecorationExpression(node, member);
if (expression) {
if (!expressions) {
@@ -74870,8 +74873,8 @@ var ts;
return;
}
necessaryTypeRefernces = necessaryTypeRefernces || ts.createMap();
- for (var _i = 0, typeReferenceDirectives_1 = typeReferenceDirectives; _i < typeReferenceDirectives_1.length; _i++) {
- var ref = typeReferenceDirectives_1[_i];
+ for (var _i = 0, typeReferenceDirectives_2 = typeReferenceDirectives; _i < typeReferenceDirectives_2.length; _i++) {
+ var ref = typeReferenceDirectives_2[_i];
necessaryTypeRefernces.set(ref, true);
}
}
@@ -75779,7 +75782,7 @@ var ts;
var prop = ts.createProperty(/*decorators*/ undefined, maskModifiers(node, /*mask*/ undefined, (!accessors.setAccessor) ? 64 /* Readonly */ : 0 /* None */), node.name, node.questionToken, ensureType(node, accessorType), /*initializer*/ undefined);
var leadingsSyntheticCommentRanges = accessors.secondAccessor && ts.getLeadingCommentRangesOfNode(accessors.secondAccessor, currentSourceFile);
if (leadingsSyntheticCommentRanges) {
- var _loop_7 = function (range) {
+ var _loop_10 = function (range) {
if (range.kind === 3 /* MultiLineCommentTrivia */) {
var text = currentSourceFile.text.slice(range.pos + 2, range.end - 2);
var lines = text.split(/\r\n?|\n/g);
@@ -75793,7 +75796,7 @@ var ts;
};
for (var _i = 0, leadingsSyntheticCommentRanges_1 = leadingsSyntheticCommentRanges; _i < leadingsSyntheticCommentRanges_1.length; _i++) {
var range = leadingsSyntheticCommentRanges_1[_i];
- _loop_7(range);
+ _loop_10(range);
}
}
return prop;
@@ -76002,8 +76005,8 @@ var ts;
}
};
// Ensure the parse tree is clean before applying transformations
- for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) {
- var node = nodes_3[_i];
+ for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) {
+ var node = nodes_4[_i];
ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node)));
}
ts.performance.mark("beforeTransform");
@@ -76194,8 +76197,8 @@ var ts;
function dispose() {
if (state < 3 /* Disposed */) {
// Clean up emit nodes on parse tree
- for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) {
- var node = nodes_4[_i];
+ for (var _i = 0, nodes_5 = nodes; _i < nodes_5.length; _i++) {
+ var node = nodes_5[_i];
ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node)));
}
// Release references to external entries for GC purposes.
@@ -79751,8 +79754,8 @@ var ts;
function writeLines(text) {
var lines = text.split(/\r\n?|\n/g);
var indentation = ts.guessIndentation(lines);
- for (var _a = 0, lines_1 = lines; _a < lines_1.length; _a++) {
- var lineText = lines_1[_a];
+ for (var _a = 0, lines_2 = lines; _a < lines_2.length; _a++) {
+ var lineText = lines_2[_a];
var line = indentation ? lineText.slice(indentation) : lineText;
if (line.length) {
writeLine();
@@ -81280,13 +81283,13 @@ var ts;
// which per above occurred during the current program creation.
// Since we assume the filesystem does not change during program creation,
// it is safe to reuse resolutions from the earlier call.
- var result_3 = [];
+ var result_4 = [];
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
var moduleName = moduleNames_1[_i];
var resolvedModule = file.resolvedModules.get(moduleName);
- result_3.push(resolvedModule);
+ result_4.push(resolvedModule);
}
- return result_3;
+ return result_4;
}
// At this point, we know at least one of the following hold:
// - file has local declarations for ambient modules
@@ -81984,8 +81987,8 @@ var ts;
}
break;
}
- for (var _b = 0, nodes_5 = nodes; _b < nodes_5.length; _b++) {
- var node = nodes_5[_b];
+ for (var _b = 0, nodes_6 = nodes; _b < nodes_6.length; _b++) {
+ var node = nodes_6[_b];
walk(node);
}
}
@@ -82642,14 +82645,14 @@ var ts;
if (options.composite && rootNames.length < files.length) {
var normalizedRootNames = rootNames.map(function (r) { return ts.normalizePath(r).toLowerCase(); });
var sourceFiles = files.filter(function (f) { return !f.isDeclarationFile; }).map(function (f) { return ts.normalizePath(f.path).toLowerCase(); });
- var _loop_8 = function (file) {
+ var _loop_11 = function (file) {
if (normalizedRootNames.every(function (r) { return r !== file; })) {
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file));
}
};
for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) {
var file = sourceFiles_4[_i];
- _loop_8(file);
+ _loop_11(file);
}
}
if (options.paths) {
@@ -84518,8 +84521,8 @@ var ts;
function tryGetAnyFileFromPath(host, path) {
// We check all js, `node` and `json` extensions in addition to TS, since node module resolution would also choose those over the directory
var extensions = ts.getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { extension: "json", isMixedContent: false, scriptKind: 6 /* JSON */ }]);
- for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) {
- var e = extensions_1[_i];
+ for (var _i = 0, extensions_3 = extensions; _i < extensions_3.length; _i++) {
+ var e = extensions_3[_i];
var fullPath = path + e;
if (host.fileExists(fullPath)) { // TODO: GH#18217
return fullPath;
@@ -85417,7 +85420,6 @@ var ts;
getKeys: getKeys
};
}
- ts.createDependencyMapper = createDependencyMapper;
function getOutputDeclarationFileName(inputFileName, configFile) {
var relativePath = ts.getRelativePathFromDirectory(rootDirOfOptions(configFile.options, configFile.options.configFilePath), inputFileName, /*ignoreCase*/ true);
var outputPath = ts.resolvePath(configFile.options.declarationDir || configFile.options.outDir || ts.getDirectoryPath(configFile.options.configFilePath), relativePath);
@@ -85543,8 +85545,8 @@ var ts;
var clean = false;
var watch = false;
var projects = [];
- for (var _i = 0, args_3 = args; _i < args_3.length; _i++) {
- var arg = args_3[_i];
+ for (var _i = 0, args_6 = args; _i < args_6.length; _i++) {
+ var arg = args_6[_i];
switch (arg.toLowerCase()) {
case "-v":
case "--verbose":
@@ -85568,23 +85570,28 @@ var ts;
case "--?":
case "-?":
case "--help":
- return ts.printHelp(buildOpts, "--build ");
+ ts.printHelp(buildOpts, "--build ");
+ return ts.ExitStatus.Success;
}
// Not a flag, parse as filename
addProject(arg);
}
// Nonsensical combinations
if (clean && force) {
- return buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force");
+ buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force");
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (clean && verbose) {
- return buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "verbose");
+ buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "verbose");
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (clean && watch) {
- return buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "watch");
+ buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "watch");
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (watch && dry) {
- return buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry");
+ buildHost.error(ts.Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry");
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (projects.length === 0) {
// tsc -b invoked with no extra arguments; act as if invoked with "tsc -b ."
@@ -85592,14 +85599,13 @@ var ts;
}
var builder = createSolutionBuilder(compilerHost, buildHost, projects, { dry: dry, force: force, verbose: verbose }, system);
if (clean) {
- builder.cleanAllProjects();
- }
- else {
- builder.buildAllProjects();
+ return builder.cleanAllProjects();
}
if (watch) {
- return builder.startWatching();
+ builder.startWatching();
+ return undefined;
}
+ return builder.buildAllProjects();
function addProject(projectSpecification) {
var fileName = ts.resolvePath(compilerHost.getCurrentDirectory(), projectSpecification);
var refPath = ts.resolveProjectReferencePath(compilerHost, { path: fileName });
@@ -85647,7 +85653,7 @@ var ts;
// Everything is broken - we don't even know what to watch. Give up.
return;
}
- var _loop_9 = function (resolved) {
+ var _loop_12 = function (resolved) {
var cfg = configFileCache.parseConfigFile(resolved);
if (cfg) {
// Watch this file
@@ -85674,7 +85680,7 @@ var ts;
};
for (var _i = 0, _a = graph.buildQueue; _i < _a.length; _i++) {
var resolved = _a[_i];
- _loop_9(resolved);
+ _loop_12(resolved);
}
function invalidateProjectAndScheduleBuilds(resolved) {
invalidateProject(resolved);
@@ -85855,9 +85861,11 @@ var ts;
}
}
var pseudoUpToDate = false;
+ var usesPrepend = false;
if (project.projectReferences) {
for (var _c = 0, _d = project.projectReferences; _c < _d.length; _c++) {
var ref = _d[_c];
+ usesPrepend = usesPrepend || !!(ref.prepend);
var resolvedRef = ts.resolveProjectReferencePath(compilerHost, ref);
var refStatus = getUpToDateStatus(configFileCache.parseConfigFile(resolvedRef));
// An upstream project is blocked
@@ -85907,6 +85915,9 @@ var ts;
newerInputFileName: newestInputFileName
};
}
+ if (usesPrepend) {
+ pseudoUpToDate = false;
+ }
// Up to date
return {
type: pseudoUpToDate ? UpToDateStatusType.UpToDateWithUpstreamTypes : UpToDateStatusType.UpToDate,
@@ -86110,14 +86121,17 @@ var ts;
function cleanAllProjects() {
var resolvedNames = getAllProjectsInScope();
if (resolvedNames === undefined) {
- return buildHost.message(ts.Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
+ buildHost.message(ts.Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
var filesToDelete = getFilesToClean(resolvedNames);
if (filesToDelete === undefined) {
- return buildHost.message(ts.Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
+ buildHost.message(ts.Diagnostics.Skipping_clean_because_not_all_projects_could_be_located);
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
}
if (context.options.dry) {
- return buildHost.message(ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+ buildHost.message(ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+ return ts.ExitStatus.Success;
}
// Do this check later to allow --clean --dry to function even if the host can't delete files
if (!compilerHost.deleteFile) {
@@ -86127,6 +86141,7 @@ var ts;
var output = filesToDelete_1[_i];
compilerHost.deleteFile(output);
}
+ return ts.ExitStatus.Success;
}
function resolveProjectName(name) {
var fullPath = ts.resolvePath(compilerHost.getCurrentDirectory(), name);
@@ -86155,13 +86170,15 @@ var ts;
function buildAllProjects() {
var graph = getGlobalDependencyGraph();
if (graph === undefined)
- return;
+ return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
var queue = graph.buildQueue;
reportBuildQueue(graph);
+ var anyFailed = false;
for (var _i = 0, queue_1 = queue; _i < queue_1.length; _i++) {
var next = queue_1[_i];
var proj = configFileCache.parseConfigFile(next);
if (proj === undefined) {
+ anyFailed = true;
break;
}
var status = getUpToDateStatus(proj);
@@ -86189,8 +86206,10 @@ var ts;
// Do nothing
continue;
}
- buildSingleProject(next);
+ var buildResult = buildSingleProject(next);
+ anyFailed = anyFailed || !!(buildResult & BuildResultFlags.AnyErrors);
}
+ return anyFailed ? ts.ExitStatus.DiagnosticsPresent_OutputsSkipped : ts.ExitStatus.Success;
}
/**
* Report the build ordering inferred from the current project graph if we're in verbose mode
@@ -111557,6 +111576,7 @@ var TypeScript;
var toolsVersion = ts.versionMajorMinor;
//# sourceMappingURL=services.js.map
"use strict";
+/* @internal */
var ts;
(function (ts) {
var server;
diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts
index 2cfb99444e5..6de868d459a 100644
--- a/lib/tsserverlibrary.d.ts
+++ b/lib/tsserverlibrary.d.ts
@@ -13,6 +13,13 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
+
+
+declare namespace ts {
+ const versionMajorMinor = "3.0";
+ /** The version of the TypeScript compiler release */
+ const version: string;
+}
declare namespace ts {
/**
* Type of objects whose values are all of the same type.
@@ -22,6 +29,9 @@ declare namespace ts {
interface MapLike {
[index: string]: T;
}
+ interface SortedArray extends Array {
+ " __sortedArrayBrand": any;
+ }
/** ES6 Map interface, only read methods included. */
interface ReadonlyMap {
get(key: string): T | undefined;
@@ -52,6 +62,528 @@ declare namespace ts {
interface Push {
push(...values: T[]): void;
}
+ type EqualityComparer = (a: T, b: T) => boolean;
+ type Comparer = (a: T, b: T) => Comparison;
+ enum Comparison {
+ LessThan = -1,
+ EqualTo = 0,
+ GreaterThan = 1
+ }
+}
+declare namespace ts {
+ /** Create a new map. If a template object is provided, the map will copy entries from it. */
+ function createMap(): Map;
+ function createMapFromEntries(entries: [string, T][]): Map;
+ function createMapFromTemplate(template: MapLike): Map;
+ const MapCtr: new () => Map;
+ function length(array: ReadonlyArray | undefined): number;
+ /**
+ * Iterates through 'array' by index and performs the callback on each element of array until the callback
+ * returns a truthy value, then returns that value.
+ * If no such value is found, the callback is applied to each element of array and undefined is returned.
+ */
+ function forEach(array: ReadonlyArray | undefined, callback: (element: T, index: number) => U | undefined): U | undefined;
+ /** Like `forEach`, but suitable for use with numbers and strings (which may be falsy). */
+ function firstDefined(array: ReadonlyArray | undefined, callback: (element: T, index: number) => U | undefined): U | undefined;
+ function firstDefinedIterator(iter: Iterator, callback: (element: T) => U | undefined): U | undefined;
+ function zipWith(arrayA: ReadonlyArray, arrayB: ReadonlyArray, callback: (a: T, b: U, index: number) => V): V[];
+ function zipToIterator(arrayA: ReadonlyArray, arrayB: ReadonlyArray): Iterator<[T, U]>;
+ function zipToMap(keys: ReadonlyArray, values: ReadonlyArray): Map;
+ /**
+ * Iterates through `array` by index and performs the callback on each element of array until the callback
+ * returns a falsey value, then returns false.
+ * If no such value is found, the callback is applied to each element of array and `true` is returned.
+ */
+ function every(array: ReadonlyArray, callback: (element: T, index: number) => boolean): boolean;
+ /** Works like Array.prototype.find, returning `undefined` if no element satisfying the predicate is found. */
+ function find(array: ReadonlyArray, predicate: (element: T, index: number) => element is U): U | undefined;
+ function find(array: ReadonlyArray, predicate: (element: T, index: number) => boolean): T | undefined;
+ function findLast(array: ReadonlyArray, predicate: (element: T, index: number) => element is U): U | undefined;
+ function findLast(array: ReadonlyArray, predicate: (element: T, index: number) => boolean): T | undefined;
+ /** Works like Array.prototype.findIndex, returning `-1` if no element satisfying the predicate is found. */
+ function findIndex(array: ReadonlyArray, predicate: (element: T, index: number) => boolean, startIndex?: number): number;
+ function findLastIndex(array: ReadonlyArray, predicate: (element: T, index: number) => boolean, startIndex?: number): number;
+ /**
+ * Returns the first truthy result of `callback`, or else fails.
+ * This is like `forEach`, but never returns undefined.
+ */
+ function findMap(array: ReadonlyArray, callback: (element: T, index: number) => U | undefined): U;
+ function contains(array: ReadonlyArray | undefined, value: T, equalityComparer?: EqualityComparer): boolean;
+ function arraysEqual(a: ReadonlyArray, b: ReadonlyArray, equalityComparer?: EqualityComparer): boolean;
+ function indexOfAnyCharCode(text: string, charCodes: ReadonlyArray, start?: number): number;
+ function countWhere(array: ReadonlyArray, predicate: (x: T, i: number) => boolean): number;
+ /**
+ * Filters an array by a predicate function. Returns the same array instance if the predicate is
+ * true for all elements, otherwise returns a new array instance containing the filtered subset.
+ */
+ function filter(array: T[], f: (x: T) => x is U): U[];
+ function filter(array: T[], f: (x: T) => boolean): T[];
+ function filter(array: ReadonlyArray, f: (x: T) => x is U): ReadonlyArray;
+ function filter(array: ReadonlyArray, f: (x: T) => boolean): ReadonlyArray;
+ function filter(array: T[] | undefined, f: (x: T) => x is U): U[] | undefined;
+ function filter(array: T[] | undefined, f: (x: T) => boolean): T[] | undefined;
+ function filter(array: ReadonlyArray | undefined, f: (x: T) => x is U): ReadonlyArray | undefined;
+ function filter(array: ReadonlyArray | undefined, f: (x: T) => boolean): ReadonlyArray | undefined;
+ function filterMutate(array: T[], f: (x: T, i: number, array: T[]) => boolean): void;
+ function clear(array: {}[]): void;
+ function map(array: ReadonlyArray, f: (x: T, i: number) => U): U[];
+ function map(array: ReadonlyArray | undefined, f: (x: T, i: number) => U): U[] | undefined;
+ function mapIterator(iter: Iterator, mapFn: (x: T) => U): Iterator;
+ function sameMap(array: T[], f: (x: T, i: number) => T): T[];
+ function sameMap(array: ReadonlyArray, f: (x: T, i: number) => T): ReadonlyArray;
+ function sameMap(array: T[] | undefined, f: (x: T, i: number) => T): T[] | undefined;
+ function sameMap(array: ReadonlyArray | undefined, f: (x: T, i: number) => T): ReadonlyArray | undefined;
+ /**
+ * Flattens an array containing a mix of array or non-array elements.
+ *
+ * @param array The array to flatten.
+ */
+ function flatten(array: ReadonlyArray | undefined>): T[];
+ function flatten(array: ReadonlyArray | undefined> | undefined): T[] | undefined;
+ /**
+ * Maps an array. If the mapped value is an array, it is spread into the result.
+ *
+ * @param array The array to map.
+ * @param mapfn The callback used to map the result into one or more values.
+ */
+ function flatMap(array: ReadonlyArray, mapfn: (x: T, i: number) => U | ReadonlyArray | undefined): U[];
+ function flatMap(array: ReadonlyArray | undefined, mapfn: (x: T, i: number) => U | ReadonlyArray | undefined): U[] | undefined;
+ function flatMapIterator(iter: Iterator, mapfn: (x: T) => U[] | Iterator | undefined): Iterator;
+ /**
+ * Maps an array. If the mapped value is an array, it is spread into the result.
+ * Avoids allocation if all elements map to themselves.
+ *
+ * @param array The array to map.
+ * @param mapfn The callback used to map the result into one or more values.
+ */
+ function sameFlatMap(array: T[], mapfn: (x: T, i: number) => T | ReadonlyArray): T[];
+ function sameFlatMap(array: ReadonlyArray, mapfn: (x: T, i: number) => T | ReadonlyArray): ReadonlyArray;
+ function mapAllOrFail(array: ReadonlyArray, mapFn: (x: T, i: number) => U | undefined): U[] | undefined;
+ function mapDefined(array: ReadonlyArray | undefined, mapFn: (x: T, i: number) => U | undefined): U[];
+ function mapDefinedIterator(iter: Iterator, mapFn: (x: T) => U | undefined): Iterator;
+ const emptyIterator: Iterator;
+ function singleIterator(value: T): Iterator;
+ /**
+ * Maps contiguous spans of values with the same key.
+ *
+ * @param array The array to map.
+ * @param keyfn A callback used to select the key for an element.
+ * @param mapfn A callback used to map a contiguous chunk of values to a single value.
+ */
+ function spanMap(array: ReadonlyArray, keyfn: (x: T, i: number) => K, mapfn: (chunk: T[], key: K, start: number, end: number) => U): U[];
+ function spanMap(array: ReadonlyArray | undefined, keyfn: (x: T, i: number) => K, mapfn: (chunk: T[], key: K, start: number, end: number) => U): U[] | undefined;
+ function mapEntries(map: ReadonlyMap, f: (key: string, value: T) => [string, U]): Map;
+ function mapEntries(map: ReadonlyMap | undefined, f: (key: string, value: T) => [string, U]): Map | undefined;
+ function some(array: ReadonlyArray | undefined): array is ReadonlyArray;
+ function some(array: ReadonlyArray | undefined, predicate: (value: T) => boolean): boolean;
+ /** Calls the callback with (start, afterEnd) index pairs for each range where 'pred' is true. */
+ function getRangesWhere(arr: ReadonlyArray, pred: (t: T) => boolean, cb: (start: number, afterEnd: number) => void): void;
+ function concatenate(array1: T[], array2: T[]): T[];
+ function concatenate(array1: ReadonlyArray, array2: ReadonlyArray): ReadonlyArray;
+ function concatenate(array1: T[] | undefined, array2: T[] | undefined): T[];
+ function concatenate(array1: ReadonlyArray | undefined, array2: ReadonlyArray | undefined): ReadonlyArray;
+ /**
+ * Deduplicates an unsorted array.
+ * @param equalityComparer An optional `EqualityComparer` used to determine if two values are duplicates.
+ * @param comparer An optional `Comparer` used to sort entries before comparison, though the
+ * result will remain in the original order in `array`.
+ */
+ function deduplicate(array: ReadonlyArray, equalityComparer?: EqualityComparer, comparer?: Comparer): T[];
+ function deduplicate(array: ReadonlyArray | undefined, equalityComparer?: EqualityComparer, comparer?: Comparer): T[] | undefined;
+ function insertSorted(array: SortedArray, insert: T, compare: Comparer): void;
+ function sortAndDeduplicate(array: ReadonlyArray, comparer: Comparer, equalityComparer?: EqualityComparer): T[];
+ function arrayIsEqualTo(array1: ReadonlyArray | undefined, array2: ReadonlyArray | undefined, equalityComparer?: (a: T, b: T) => boolean): boolean;
+ /**
+ * Compacts an array, removing any falsey elements.
+ */
+ function compact(array: T[]): T[];
+ function compact(array: ReadonlyArray): ReadonlyArray;
+ /**
+ * Gets the relative complement of `arrayA` with respect to `arrayB`, returning the elements that
+ * are not present in `arrayA` but are present in `arrayB`. Assumes both arrays are sorted
+ * based on the provided comparer.
+ */
+ function relativeComplement(arrayA: T[] | undefined, arrayB: T[] | undefined, comparer: Comparer): T[] | undefined;
+ function sum, K extends string>(array: ReadonlyArray, prop: K): number;
+ /**
+ * Appends a value to an array, returning the array.
+ *
+ * @param to The array to which `value` is to be appended. If `to` is `undefined`, a new array
+ * is created if `value` was appended.
+ * @param value The value to append to the array. If `value` is `undefined`, nothing is
+ * appended.
+ */
+ function append(to: T[], value: T | undefined): T[];
+ function append(to: T[] | undefined, value: T): T[];
+ function append(to: T[] | undefined, value: T | undefined): T[] | undefined;
+ function append(to: Push, value: T | undefined): void;
+ /**
+ * Appends a range of value to an array, returning the array.
+ *
+ * @param to The array to which `value` is to be appended. If `to` is `undefined`, a new array
+ * is created if `value` was appended.
+ * @param from The values to append to the array. If `from` is `undefined`, nothing is
+ * appended. If an element of `from` is `undefined`, that element is not appended.
+ * @param start The offset in `from` at which to start copying values.
+ * @param end The offset in `from` at which to stop copying values (non-inclusive).
+ */
+ function addRange(to: T[], from: ReadonlyArray | undefined, start?: number, end?: number): T[];
+ function addRange(to: T[] | undefined, from: ReadonlyArray | undefined, start?: number, end?: number): T[] | undefined;
+ /**
+ * @return Whether the value was added.
+ */
+ function pushIfUnique(array: T[], toAdd: T, equalityComparer?: EqualityComparer): boolean;
+ /**
+ * Unlike `pushIfUnique`, this can take `undefined` as an input, and returns a new array.
+ */
+ function appendIfUnique(array: T[] | undefined, toAdd: T, equalityComparer?: EqualityComparer): T[];
+ /**
+ * Returns a new sorted array.
+ */
+ function sort(array: ReadonlyArray, comparer: Comparer): T[];
+ function best(iter: Iterator, isBetter: (a: T, b: T) => boolean): T | undefined;
+ function arrayIterator(array: ReadonlyArray): Iterator;
+ /**
+ * Stable sort of an array. Elements equal to each other maintain their relative position in the array.
+ */
+ function stableSort(array: ReadonlyArray, comparer: Comparer): T[];
+ function rangeEquals(array1: ReadonlyArray, array2: ReadonlyArray, pos: number, end: number): boolean;
+ /**
+ * Returns the element at a specific offset in an array if non-empty, `undefined` otherwise.
+ * A negative offset indicates the element should be retrieved from the end of the array.
+ */
+ function elementAt(array: ReadonlyArray | undefined, offset: number): T | undefined;
+ /**
+ * Returns the first element of an array if non-empty, `undefined` otherwise.
+ */
+ function firstOrUndefined(array: ReadonlyArray): T | undefined;
+ function first(array: ReadonlyArray): T;
+ /**
+ * Returns the last element of an array if non-empty, `undefined` otherwise.
+ */
+ function lastOrUndefined(array: ReadonlyArray): T | undefined;
+ function last(array: ReadonlyArray): T;
+ /**
+ * Returns the only element of an array if it contains only one element, `undefined` otherwise.
+ */
+ function singleOrUndefined(array: ReadonlyArray | undefined): T | undefined;
+ /**
+ * Returns the only element of an array if it contains only one element; otheriwse, returns the
+ * array.
+ */
+ function singleOrMany(array: T[]): T | T[];
+ function singleOrMany(array: ReadonlyArray): T | ReadonlyArray;
+ function singleOrMany(array: T[] | undefined): T | T[] | undefined;
+ function singleOrMany(array: ReadonlyArray | undefined): T | ReadonlyArray | undefined;
+ function replaceElement(array: ReadonlyArray, index: number, value: T): T[];
+ /**
+ * Performs a binary search, finding the index at which `value` occurs in `array`.
+ * If no such index is found, returns the 2's-complement of first index at which
+ * `array[index]` exceeds `value`.
+ * @param array A sorted array whose first element must be no larger than number
+ * @param value The value to be searched for in the array.
+ * @param keySelector A callback used to select the search key from `value` and each element of
+ * `array`.
+ * @param keyComparer A callback used to compare two keys in a sorted array.
+ * @param offset An offset into `array` at which to start the search.
+ */
+ function binarySearch(array: ReadonlyArray, value: T, keySelector: (v: T) => U, keyComparer: Comparer, offset?: number): number;
+ function reduceLeft(array: ReadonlyArray | undefined, f: (memo: U, value: T, i: number) => U, initial: U, start?: number, count?: number): U;
+ function reduceLeft(array: ReadonlyArray, f: (memo: T, value: T, i: number) => T): T | undefined;
+ /**
+ * Indicates whether a map-like contains an own property with the specified key.
+ *
+ * @param map A map-like.
+ * @param key A property key.
+ */
+ function hasProperty(map: MapLike, key: string): boolean;
+ /**
+ * Gets the value of an owned property in a map-like.
+ *
+ * @param map A map-like.
+ * @param key A property key.
+ */
+ function getProperty(map: MapLike, key: string): T | undefined;
+ /**
+ * Gets the owned, enumerable property keys of a map-like.
+ */
+ function getOwnKeys(map: MapLike): string[];
+ function getOwnValues(sparseArray: T[]): T[];
+ /** Shims `Array.from`. */
+ function arrayFrom(iterator: Iterator, map: (t: T) => U): U[];
+ function arrayFrom(iterator: Iterator): T[];
+ function assign(t: T, ...args: (T | undefined)[]): T;
+ /**
+ * Performs a shallow equality comparison of the contents of two map-likes.
+ *
+ * @param left A map-like whose properties should be compared.
+ * @param right A map-like whose properties should be compared.
+ */
+ function equalOwnProperties(left: MapLike | undefined, right: MapLike | undefined, equalityComparer?: EqualityComparer): boolean;
+ /**
+ * Creates a map from the elements of an array.
+ *
+ * @param array the array of input elements.
+ * @param makeKey a function that produces a key for a given element.
+ *
+ * This function makes no effort to avoid collisions; if any two elements produce
+ * the same key with the given 'makeKey' function, then the element with the higher
+ * index in the array will be the one associated with the produced key.
+ */
+ function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string | undefined): Map;
+ function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string | undefined, makeValue: (value: T) => U): Map;
+ function arrayToNumericMap(array: ReadonlyArray, makeKey: (value: T) => number): T[];
+ function arrayToNumericMap(array: ReadonlyArray