mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into assertionsInControlFlow
This commit is contained in:
+20
-20
@@ -41,7 +41,7 @@ const generateLibs = () => {
|
||||
.pipe(concat(relativeTarget, { newLine: "\n\n" }))
|
||||
.pipe(dest("built/local"))));
|
||||
};
|
||||
task("lib", generateLibs)
|
||||
task("lib", generateLibs);
|
||||
task("lib").description = "Builds the library targets";
|
||||
|
||||
const cleanLib = () => del(libs.map(lib => lib.target));
|
||||
@@ -168,7 +168,7 @@ task("services", series(preBuild, buildServices));
|
||||
task("services").description = "Builds the language service";
|
||||
task("services").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
const cleanServices = async () => {
|
||||
if (fs.existsSync("built/local/typescriptServices.tsconfig.json")) {
|
||||
@@ -200,14 +200,14 @@ task("watch-services", series(preBuild, parallel(watchLib, watchDiagnostics, wat
|
||||
task("watch-services").description = "Watches for changes and rebuild language service only";
|
||||
task("watch-services").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
const buildServer = () => buildProject("src/tsserver", cmdLineOptions);
|
||||
task("tsserver", series(preBuild, buildServer));
|
||||
task("tsserver").description = "Builds the language server";
|
||||
task("tsserver").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
const cleanServer = () => cleanProject("src/tsserver");
|
||||
cleanTasks.push(cleanServer);
|
||||
@@ -219,13 +219,13 @@ task("watch-tsserver", series(preBuild, parallel(watchLib, watchDiagnostics, wat
|
||||
task("watch-tsserver").description = "Watch for changes and rebuild the language server only";
|
||||
task("watch-tsserver").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
task("min", series(preBuild, parallel(buildTsc, buildServer)));
|
||||
task("min").description = "Builds only tsc and tsserver";
|
||||
task("min").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
task("clean-min", series(cleanTsc, cleanServer));
|
||||
task("clean-min").description = "Cleans outputs for tsc and tsserver";
|
||||
@@ -234,7 +234,7 @@ task("watch-min", series(preBuild, parallel(watchLib, watchDiagnostics, watchTsc
|
||||
task("watch-min").description = "Watches for changes to a tsc and tsserver only";
|
||||
task("watch-min").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
const buildLssl = (() => {
|
||||
// build tsserverlibrary.out.js
|
||||
@@ -268,7 +268,7 @@ task("lssl", series(preBuild, buildLssl));
|
||||
task("lssl").description = "Builds language service server library";
|
||||
task("lssl").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
const cleanLssl = async () => {
|
||||
if (fs.existsSync("built/local/tsserverlibrary.tsconfig.json")) {
|
||||
@@ -302,14 +302,14 @@ task("watch-lssl", series(preBuild, parallel(watchLib, watchDiagnostics, watchLs
|
||||
task("watch-lssl").description = "Watch for changes and rebuild tsserverlibrary only";
|
||||
task("watch-lssl").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
const buildTests = () => buildProject("src/testRunner");
|
||||
task("tests", series(preBuild, parallel(buildLssl, buildTests)));
|
||||
task("tests").description = "Builds the test infrastructure";
|
||||
task("tests").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
const cleanTests = () => cleanProject("src/testRunner");
|
||||
cleanTasks.push(cleanTests);
|
||||
@@ -381,13 +381,13 @@ task("local", series(buildFoldStart, preBuild, parallel(localize, buildTsc, buil
|
||||
task("local").description = "Builds the full compiler and services";
|
||||
task("local").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
task("watch-local", series(preBuild, parallel(watchLib, watchDiagnostics, watchTsc, watchServices, watchServer, watchLssl)));
|
||||
task("watch-local").description = "Watches for changes to projects in src/ (but does not execute tests).";
|
||||
task("watch-local").flags = {
|
||||
" --built": "Compile using the built version of the compiler."
|
||||
}
|
||||
};
|
||||
|
||||
const generateCodeCoverage = () => exec("istanbul", ["cover", "node_modules/mocha/bin/_mocha", "--", "-R", "min", "-t", "" + cmdLineOptions.testTimeout, "built/local/run.js"]);
|
||||
task("generate-code-coverage", series(preBuild, buildTests, generateCodeCoverage));
|
||||
@@ -417,7 +417,7 @@ task("runtests").flags = {
|
||||
" --built": "Compile using the built version of the compiler.",
|
||||
" --shards": "Total number of shards running tests (default: 1)",
|
||||
" --shardId": "1-based ID of this shard (default: 1)",
|
||||
}
|
||||
};
|
||||
|
||||
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ true, /*watchMode*/ false);
|
||||
task("runtests-parallel", series(preBuild, preTest, runTestsParallel, postTest));
|
||||
@@ -436,10 +436,10 @@ task("runtests-parallel").flags = {
|
||||
" --shardId": "1-based ID of this shard (default: 1)",
|
||||
};
|
||||
|
||||
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true }));
|
||||
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true, waitForExit: false }));
|
||||
task("diff").description = "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable";
|
||||
|
||||
task("diff-rwc", () => exec(getDiffTool(), [refRwcBaseline, localRwcBaseline], { ignoreExitCode: true }));
|
||||
task("diff-rwc", () => exec(getDiffTool(), [refRwcBaseline, localRwcBaseline], { ignoreExitCode: true, waitForExit: false }));
|
||||
task("diff-rwc").description = "Diffs the RWC baselines using the diff tool specified by the 'DIFF' environment variable";
|
||||
|
||||
/**
|
||||
@@ -478,7 +478,7 @@ task("tsc-instrumented", series(lkgPreBuild, parallel(localize, buildTsc, buildS
|
||||
task("tsc-instrumented").description = "Builds an instrumented tsc.js";
|
||||
task("tsc-instrumented").flags = {
|
||||
"-t --tests=<testname>": "The test to run."
|
||||
}
|
||||
};
|
||||
|
||||
// TODO(rbuckton): Determine if we still need this task. Depending on a relative
|
||||
// path here seems like a bad idea.
|
||||
@@ -533,7 +533,7 @@ task("LKG", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildS
|
||||
task("LKG").description = "Makes a new LKG out of the built js files";
|
||||
task("LKG").flags = {
|
||||
" --built": "Compile using the built version of the compiler.",
|
||||
}
|
||||
};
|
||||
|
||||
const generateSpec = () => exec("cscript", ["//nologo", "scripts/word2md.js", path.resolve("doc/TypeScript Language Specification.docx"), path.resolve("doc/spec.md")]);
|
||||
task("generate-spec", series(buildScripts, generateSpec));
|
||||
@@ -542,15 +542,15 @@ task("generate-spec").description = "Generates a Markdown version of the Languag
|
||||
task("clean", series(parallel(cleanTasks), cleanBuilt));
|
||||
task("clean").description = "Cleans build outputs";
|
||||
|
||||
const configureNightly = () => exec(process.execPath, ["scripts/configurePrerelease.js", "dev", "package.json", "src/compiler/core.ts"])
|
||||
const configureNightly = () => exec(process.execPath, ["scripts/configurePrerelease.js", "dev", "package.json", "src/compiler/core.ts"]);
|
||||
task("configure-nightly", series(buildScripts, configureNightly));
|
||||
task("configure-nightly").description = "Runs scripts/configurePrerelease.ts to prepare a build for nightly publishing";
|
||||
|
||||
const configureInsiders = () => exec(process.execPath, ["scripts/configurePrerelease.js", "insiders", "package.json", "src/compiler/core.ts"])
|
||||
const configureInsiders = () => exec(process.execPath, ["scripts/configurePrerelease.js", "insiders", "package.json", "src/compiler/core.ts"]);
|
||||
task("configure-insiders", series(buildScripts, configureInsiders));
|
||||
task("configure-insiders").description = "Runs scripts/configurePrerelease.ts to prepare a build for insiders publishing";
|
||||
|
||||
const configureExperimental = () => exec(process.execPath, ["scripts/configurePrerelease.js", "experimental", "package.json", "src/compiler/core.ts"])
|
||||
const configureExperimental = () => exec(process.execPath, ["scripts/configurePrerelease.js", "experimental", "package.json", "src/compiler/core.ts"]);
|
||||
task("configure-experimental", series(buildScripts, configureExperimental));
|
||||
task("configure-experimental").description = "Runs scripts/configurePrerelease.ts to prepare a build for experimental publishing";
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -42,6 +42,7 @@
|
||||
"@types/gulp-sourcemaps": "0.0.32",
|
||||
"@types/jake": "latest",
|
||||
"@types/merge2": "latest",
|
||||
"@types/microsoft__typescript-etw": "latest",
|
||||
"@types/minimatch": "latest",
|
||||
"@types/minimist": "latest",
|
||||
"@types/mkdirp": "latest",
|
||||
@@ -109,7 +110,8 @@
|
||||
"browser": {
|
||||
"fs": false,
|
||||
"os": false,
|
||||
"path": false
|
||||
"path": false,
|
||||
"@microsoft/typescript-etw": false
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
|
||||
+23
-15
@@ -25,10 +25,11 @@ const isWindows = /^win/.test(process.platform);
|
||||
* @property {boolean} [ignoreExitCode]
|
||||
* @property {import("prex").CancellationToken} [cancelToken]
|
||||
* @property {boolean} [hidePrompt]
|
||||
* @property {boolean} [waitForExit=true]
|
||||
*/
|
||||
function exec(cmd, args, options = {}) {
|
||||
return /**@type {Promise<{exitCode: number}>}*/(new Promise((resolve, reject) => {
|
||||
const { ignoreExitCode, cancelToken = CancellationToken.none } = options;
|
||||
const { ignoreExitCode, cancelToken = CancellationToken.none, waitForExit = true } = options;
|
||||
cancelToken.throwIfCancellationRequested();
|
||||
|
||||
// TODO (weswig): Update child_process types to add windowsVerbatimArguments to the type definition
|
||||
@@ -36,26 +37,33 @@ function exec(cmd, args, options = {}) {
|
||||
const command = isWindows ? [possiblyQuote(cmd), ...args] : [`${cmd} ${args.join(" ")}`];
|
||||
|
||||
if (!options.hidePrompt) log(`> ${chalk.green(cmd)} ${args.join(" ")}`);
|
||||
const proc = spawn(isWindows ? "cmd" : "/bin/sh", [subshellFlag, ...command], { stdio: "inherit", windowsVerbatimArguments: true });
|
||||
const proc = spawn(isWindows ? "cmd" : "/bin/sh", [subshellFlag, ...command], { stdio: waitForExit ? "inherit" : "ignore", windowsVerbatimArguments: true });
|
||||
const registration = cancelToken.register(() => {
|
||||
log(`${chalk.red("killing")} '${chalk.green(cmd)} ${args.join(" ")}'...`);
|
||||
proc.kill("SIGINT");
|
||||
proc.kill("SIGTERM");
|
||||
reject(new CancelError());
|
||||
});
|
||||
proc.on("exit", exitCode => {
|
||||
registration.unregister();
|
||||
if (exitCode === 0 || ignoreExitCode) {
|
||||
resolve({ exitCode });
|
||||
}
|
||||
else {
|
||||
reject(new Error(`Process exited with code: ${exitCode}`));
|
||||
}
|
||||
});
|
||||
proc.on("error", error => {
|
||||
registration.unregister();
|
||||
reject(error);
|
||||
});
|
||||
if (waitForExit) {
|
||||
proc.on("exit", exitCode => {
|
||||
registration.unregister();
|
||||
if (exitCode === 0 || ignoreExitCode) {
|
||||
resolve({ exitCode });
|
||||
}
|
||||
else {
|
||||
reject(new Error(`Process exited with code: ${exitCode}`));
|
||||
}
|
||||
});
|
||||
proc.on("error", error => {
|
||||
registration.unregister();
|
||||
reject(error);
|
||||
});
|
||||
}
|
||||
else {
|
||||
proc.unref();
|
||||
// wait a short period in order to allow the process to start successfully before Node exits.
|
||||
setTimeout(() => resolve({ exitCode: undefined }), 100);
|
||||
}
|
||||
}));
|
||||
}
|
||||
exports.exec = exec;
|
||||
|
||||
@@ -30,7 +30,7 @@ async function copyLocalizedDiagnostics() {
|
||||
for (const d of dir) {
|
||||
const fileName = path.join(source, d);
|
||||
if (fs.statSync(fileName).isDirectory()) {
|
||||
if (d === 'tslint') continue;
|
||||
if (d === 'tslint' || d === 'enu') continue;
|
||||
await fs.copy(fileName, path.join(dest, d));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
const MAX_UNICODE_CODEPOINT = 0x10FFFF;
|
||||
const isStart = c => /[\p{ID_Start}\u{2118}\u{212E}\u{309B}\u{309C}]/u.test(c); // Other_ID_Start explicitly included for back compat - see http://www.unicode.org/reports/tr31/#Introduction
|
||||
const isPart = c => /[\p{ID_Continue}\u{00B7}\u{0387}\u{19DA}\u{1369}\u{136A}\u{136B}\u{136C}\u{136D}\u{136E}\u{136F}\u{1370}\u{1371}]/u.test(c) || isStart(c); // Likewise for Other_ID_Continue
|
||||
const parts = [];
|
||||
let partsActive = false;
|
||||
let startsActive = false;
|
||||
const starts = [];
|
||||
|
||||
for (let i = 0; i < MAX_UNICODE_CODEPOINT; i++) {
|
||||
if (isStart(String.fromCodePoint(i)) !== startsActive) {
|
||||
starts.push(i - +startsActive);
|
||||
startsActive = !startsActive;
|
||||
}
|
||||
if (isPart(String.fromCodePoint(i)) !== partsActive) {
|
||||
parts.push(i - +partsActive);
|
||||
partsActive = !partsActive;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`/**
|
||||
* Generated by scripts/regenerate-unicode-identifier-parts.js on node ${process.version} with unicode ${process.versions.unicode}
|
||||
* based on http://www.unicode.org/reports/tr31/ and https://www.ecma-international.org/ecma-262/6.0/#sec-names-and-keywords
|
||||
* unicodeESNextIdentifierStart corresponds to the ID_Start and Other_ID_Start property, and
|
||||
* unicodeESNextIdentifierPart corresponds to ID_Continue, Other_ID_Continue, plus ID_Start and Other_ID_Start
|
||||
*/`);
|
||||
console.log(`const unicodeESNextIdentifierStart = [${starts.join(", ")}];`);
|
||||
console.log(`const unicodeESNextIdentifierPart = [${parts.join(", ")}];`);
|
||||
+25
-7
@@ -106,7 +106,9 @@ namespace ts {
|
||||
|
||||
export function bindSourceFile(file: SourceFile, options: CompilerOptions) {
|
||||
performance.mark("beforeBind");
|
||||
perfLogger.logStartBindFile("" + file.fileName);
|
||||
binder(file, options);
|
||||
perfLogger.logStopBindFile();
|
||||
performance.mark("afterBind");
|
||||
performance.measure("Bind", "beforeBind", "afterBind");
|
||||
}
|
||||
@@ -490,11 +492,11 @@ namespace ts {
|
||||
// and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed.
|
||||
if (isJSDocTypeAlias(node)) Debug.assert(isInJSFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file.
|
||||
if ((!isAmbientModule(node) && (hasExportModifier || container.flags & NodeFlags.ExportContext)) || isJSDocTypeAlias(node)) {
|
||||
if (hasModifier(node, ModifierFlags.Default) && !getDeclarationName(node)) {
|
||||
if (!container.locals || (hasModifier(node, ModifierFlags.Default) && !getDeclarationName(node))) {
|
||||
return declareSymbol(container.symbol.exports!, container.symbol, node, symbolFlags, symbolExcludes); // No local symbol for an unnamed default!
|
||||
}
|
||||
const exportKind = symbolFlags & SymbolFlags.Value ? SymbolFlags.ExportValue : 0;
|
||||
const local = declareSymbol(container.locals!, /*parent*/ undefined, node, exportKind, symbolExcludes);
|
||||
const local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes);
|
||||
local.exportSymbol = declareSymbol(container.symbol.exports!, container.symbol, node, symbolFlags, symbolExcludes);
|
||||
node.localSymbol = local;
|
||||
return local;
|
||||
@@ -1824,7 +1826,19 @@ namespace ts {
|
||||
currentFlow = { flags: FlowFlags.Start };
|
||||
parent = typeAlias;
|
||||
bind(typeAlias.typeExpression);
|
||||
if (isJSDocEnumTag(typeAlias) || !typeAlias.fullName || typeAlias.fullName.kind === SyntaxKind.Identifier) {
|
||||
const declName = getNameOfDeclaration(typeAlias);
|
||||
if ((isJSDocEnumTag(typeAlias) || !typeAlias.fullName) && declName && isPropertyAccessEntityNameExpression(declName.parent)) {
|
||||
// typedef anchored to an A.B.C assignment - we need to bind into B's namespace under name C
|
||||
const isTopLevel = isTopLevelNamespaceAssignment(declName.parent);
|
||||
if (isTopLevel) {
|
||||
bindPotentiallyMissingNamespaces(file.symbol, declName.parent, isTopLevel, !!findAncestor(declName, d => isPropertyAccessExpression(d) && d.name.escapedText === "prototype"));
|
||||
const oldContainer = container;
|
||||
container = isPropertyAccessExpression(declName.parent.expression) ? declName.parent.expression.name : declName.parent.expression;
|
||||
declareModuleMember(typeAlias, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes);
|
||||
container = oldContainer;
|
||||
}
|
||||
}
|
||||
else if (isJSDocEnumTag(typeAlias) || !typeAlias.fullName || typeAlias.fullName.kind === SyntaxKind.Identifier) {
|
||||
parent = typeAlias.parent;
|
||||
bindBlockScopedDeclaration(typeAlias, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes);
|
||||
}
|
||||
@@ -2625,7 +2639,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function bindPotentiallyMissingNamespaces(namespaceSymbol: Symbol | undefined, entityName: EntityNameExpression, isToplevel: boolean, isPrototypeProperty: boolean) {
|
||||
if (isToplevel && !isPrototypeProperty && (!namespaceSymbol || !(namespaceSymbol.flags & SymbolFlags.Namespace))) {
|
||||
if (isToplevel && !isPrototypeProperty) {
|
||||
// make symbols or add declarations for intermediate containers
|
||||
const flags = SymbolFlags.Module | SymbolFlags.Assignment;
|
||||
const excludeFlags = SymbolFlags.ValueModuleExcludes & ~SymbolFlags.Assignment;
|
||||
@@ -2660,11 +2674,15 @@ namespace ts {
|
||||
declareSymbol(symbolTable, namespaceSymbol, declaration, includes | SymbolFlags.Assignment, excludes & ~SymbolFlags.Assignment);
|
||||
}
|
||||
|
||||
function bindPropertyAssignment(name: EntityNameExpression, propertyAccess: PropertyAccessEntityNameExpression, isPrototypeProperty: boolean) {
|
||||
let namespaceSymbol = lookupSymbolForPropertyAccess(name);
|
||||
const isToplevel = isBinaryExpression(propertyAccess.parent)
|
||||
function isTopLevelNamespaceAssignment(propertyAccess: PropertyAccessEntityNameExpression) {
|
||||
return isBinaryExpression(propertyAccess.parent)
|
||||
? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === SyntaxKind.SourceFile
|
||||
: propertyAccess.parent.parent.kind === SyntaxKind.SourceFile;
|
||||
}
|
||||
|
||||
function bindPropertyAssignment(name: EntityNameExpression, propertyAccess: PropertyAccessEntityNameExpression, isPrototypeProperty: boolean) {
|
||||
let namespaceSymbol = lookupSymbolForPropertyAccess(name);
|
||||
const isToplevel = isTopLevelNamespaceAssignment(propertyAccess);
|
||||
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty);
|
||||
bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty);
|
||||
}
|
||||
|
||||
+380
-333
File diff suppressed because it is too large
Load Diff
@@ -1743,6 +1743,16 @@ namespace ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export interface TSConfig {
|
||||
compilerOptions: CompilerOptions;
|
||||
compileOnSave: boolean | undefined;
|
||||
exclude?: ReadonlyArray<string>;
|
||||
files: ReadonlyArray<string> | undefined;
|
||||
include?: ReadonlyArray<string>;
|
||||
references: ReadonlyArray<ProjectReference> | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an uncommented, complete tsconfig for use with "--showConfig"
|
||||
* @param configParseResult options to be generated into tsconfig.json
|
||||
@@ -1750,7 +1760,7 @@ namespace ts {
|
||||
* @param host provides current directory and case sensitivity services
|
||||
*/
|
||||
/** @internal */
|
||||
export function convertToTSConfig(configParseResult: ParsedCommandLine, configFileName: string, host: { getCurrentDirectory(): string, useCaseSensitiveFileNames: boolean }): object {
|
||||
export function convertToTSConfig(configParseResult: ParsedCommandLine, configFileName: string, host: { getCurrentDirectory(): string, useCaseSensitiveFileNames: boolean }): TSConfig {
|
||||
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames);
|
||||
const files = map(
|
||||
filter(
|
||||
@@ -1778,13 +1788,13 @@ namespace ts {
|
||||
build: undefined,
|
||||
version: undefined,
|
||||
},
|
||||
references: map(configParseResult.projectReferences, r => ({ ...r, path: r.originalPath, originalPath: undefined })),
|
||||
references: map(configParseResult.projectReferences, r => ({ ...r, path: r.originalPath ? r.originalPath : "", originalPath: undefined })),
|
||||
files: length(files) ? files : undefined,
|
||||
...(configParseResult.configFileSpecs ? {
|
||||
include: filterSameAsDefaultInclude(configParseResult.configFileSpecs.validatedIncludeSpecs),
|
||||
exclude: configParseResult.configFileSpecs.validatedExcludeSpecs
|
||||
} : {}),
|
||||
compilerOnSave: !!configParseResult.compileOnSave ? true : undefined
|
||||
compileOnSave: !!configParseResult.compileOnSave ? true : undefined
|
||||
};
|
||||
return config;
|
||||
}
|
||||
|
||||
@@ -1381,6 +1381,17 @@ namespace ts {
|
||||
return keys;
|
||||
}
|
||||
|
||||
export function getAllKeys(obj: object): string[] {
|
||||
const result: string[] = [];
|
||||
do {
|
||||
const names = Object.getOwnPropertyNames(obj);
|
||||
for (const name of names) {
|
||||
pushIfUnique(result, name);
|
||||
}
|
||||
} while (obj = Object.getPrototypeOf(obj));
|
||||
return result;
|
||||
}
|
||||
|
||||
export function getOwnValues<T>(sparseArray: T[]): T[] {
|
||||
const values: T[] = [];
|
||||
for (const key in sparseArray) {
|
||||
|
||||
@@ -258,4 +258,4 @@ namespace ts {
|
||||
isDebugInfoEnabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3637,15 +3637,16 @@ namespace ts {
|
||||
name: "typescript:values",
|
||||
scoped: false,
|
||||
text: `
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};`
|
||||
};
|
||||
|
||||
|
||||
@@ -665,6 +665,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
perfLogger.logStartResolveModule(moduleName /* , containingFile, ModuleResolutionKind[moduleResolution]*/);
|
||||
switch (moduleResolution) {
|
||||
case ModuleResolutionKind.NodeJs:
|
||||
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
||||
@@ -675,6 +676,8 @@ namespace ts {
|
||||
default:
|
||||
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
||||
}
|
||||
if (result && result.resolvedModule) perfLogger.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
||||
perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
|
||||
|
||||
if (perFolderCache) {
|
||||
perFolderCache.set(moduleName, result);
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace ts.moduleSpecifiers {
|
||||
|
||||
const info = getInfo(importingSourceFile.path, host);
|
||||
const moduleSourceFile = getSourceFileOfNode(moduleSymbol.valueDeclaration || getNonAugmentationDeclaration(moduleSymbol));
|
||||
const modulePaths = getAllModulePaths(files, importingSourceFile.path, moduleSourceFile.fileName, info.getCanonicalFileName, host, redirectTargetsMap);
|
||||
const modulePaths = getAllModulePaths(files, importingSourceFile.path, moduleSourceFile.originalFileName, info.getCanonicalFileName, host, redirectTargetsMap);
|
||||
|
||||
const preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
|
||||
const global = mapDefined(modulePaths, moduleFileName => tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions));
|
||||
|
||||
+23
-2
@@ -512,12 +512,16 @@ namespace ts {
|
||||
export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes = false, scriptKind?: ScriptKind): SourceFile {
|
||||
performance.mark("beforeParse");
|
||||
let result: SourceFile;
|
||||
|
||||
perfLogger.logStartParseSourceFile(fileName);
|
||||
if (languageVersion === ScriptTarget.JSON) {
|
||||
result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, ScriptKind.JSON);
|
||||
}
|
||||
else {
|
||||
result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, scriptKind);
|
||||
}
|
||||
perfLogger.logStopParseSourceFile();
|
||||
|
||||
performance.mark("afterParse");
|
||||
performance.measure("Parse", "beforeParse", "afterParse");
|
||||
return result;
|
||||
@@ -605,6 +609,8 @@ namespace ts {
|
||||
|
||||
let parsingContext: ParsingContext;
|
||||
|
||||
let notParenthesizedArrow: Map<true> | undefined;
|
||||
|
||||
// Flags that dictate what parsing context we're in. For example:
|
||||
// Whether or not we are in strict parsing mode. All that changes in strict parsing mode is
|
||||
// that some tokens that would be considered identifiers may be considered keywords.
|
||||
@@ -826,6 +832,7 @@ namespace ts {
|
||||
identifiers = undefined!;
|
||||
syntaxCursor = undefined;
|
||||
sourceText = undefined!;
|
||||
notParenthesizedArrow = undefined!;
|
||||
}
|
||||
|
||||
function parseSourceFileWorker(fileName: string, languageVersion: ScriptTarget, setParentNodes: boolean, scriptKind: ScriptKind): SourceFile {
|
||||
@@ -3688,7 +3695,17 @@ namespace ts {
|
||||
}
|
||||
|
||||
function parsePossibleParenthesizedArrowFunctionExpressionHead(): ArrowFunction | undefined {
|
||||
return parseParenthesizedArrowFunctionExpressionHead(/*allowAmbiguity*/ false);
|
||||
const tokenPos = scanner.getTokenPos();
|
||||
if (notParenthesizedArrow && notParenthesizedArrow.has(tokenPos.toString())) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const result = parseParenthesizedArrowFunctionExpressionHead(/*allowAmbiguity*/ false);
|
||||
if (!result) {
|
||||
(notParenthesizedArrow || (notParenthesizedArrow = createMap())).set(tokenPos.toString(), true);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function tryParseAsyncSimpleArrowFunctionExpression(): ArrowFunction | undefined {
|
||||
@@ -7300,10 +7317,14 @@ namespace ts {
|
||||
return createMissingNode<Identifier>(SyntaxKind.Identifier, /*reportAtCurrentPosition*/ !message, message || Diagnostics.Identifier_expected);
|
||||
}
|
||||
|
||||
identifierCount++;
|
||||
const pos = scanner.getTokenPos();
|
||||
const end = scanner.getTextPos();
|
||||
const result = <Identifier>createNode(SyntaxKind.Identifier, pos);
|
||||
result.escapedText = escapeLeadingUnderscores(scanner.getTokenText());
|
||||
if (token() !== SyntaxKind.Identifier) {
|
||||
result.originalKeywordKind = token();
|
||||
}
|
||||
result.escapedText = escapeLeadingUnderscores(internIdentifier(scanner.getTokenValue()));
|
||||
finishNode(result, end);
|
||||
|
||||
nextTokenJSDoc();
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/* @internal */
|
||||
namespace ts {
|
||||
type PerfLogger = typeof import("@microsoft/typescript-etw"); // tslint:disable-line:no-implicit-dependencies
|
||||
const nullLogger: PerfLogger = {
|
||||
logEvent: noop,
|
||||
logErrEvent: noop,
|
||||
logPerfEvent: noop,
|
||||
logInfoEvent: noop,
|
||||
logStartCommand: noop,
|
||||
logStopCommand: noop,
|
||||
logStartUpdateProgram: noop,
|
||||
logStopUpdateProgram: noop,
|
||||
logStartUpdateGraph: noop,
|
||||
logStopUpdateGraph: noop,
|
||||
logStartResolveModule: noop,
|
||||
logStopResolveModule: noop,
|
||||
logStartParseSourceFile: noop,
|
||||
logStopParseSourceFile: noop,
|
||||
logStartReadFile: noop,
|
||||
logStopReadFile: noop,
|
||||
logStartBindFile: noop,
|
||||
logStopBindFile: noop,
|
||||
logStartScheduledOperation: noop,
|
||||
logStopScheduledOperation: noop,
|
||||
};
|
||||
|
||||
// Load optional module to enable Event Tracing for Windows
|
||||
// See https://github.com/microsoft/typescript-etw for more information
|
||||
let etwModule;
|
||||
try {
|
||||
// require() will throw an exception if the module is not installed
|
||||
// It may also return undefined if not installed properly
|
||||
etwModule = require("@microsoft/typescript-etw"); // tslint:disable-line:no-implicit-dependencies
|
||||
}
|
||||
catch (e) {
|
||||
etwModule = undefined;
|
||||
}
|
||||
|
||||
/** Performance logger that will generate ETW events if possible */
|
||||
export const perfLogger: PerfLogger = etwModule ? etwModule : nullLogger;
|
||||
|
||||
perfLogger.logInfoEvent(`Starting TypeScript v${versionMajorMinor} with command line: ${JSON.stringify(process.argv)}`);
|
||||
}
|
||||
@@ -762,7 +762,7 @@ namespace ts {
|
||||
let resolveModuleNamesWorker: (moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference) => ResolvedModuleFull[];
|
||||
const hasInvalidatedResolution = host.hasInvalidatedResolution || returnFalse;
|
||||
if (host.resolveModuleNames) {
|
||||
resolveModuleNamesWorker = (moduleNames, containingFile, reusedNames, redirectedReference) => host.resolveModuleNames!(Debug.assertEachDefined(moduleNames), containingFile, reusedNames, redirectedReference).map(resolved => {
|
||||
resolveModuleNamesWorker = (moduleNames, containingFile, reusedNames, redirectedReference) => host.resolveModuleNames!(Debug.assertEachDefined(moduleNames), containingFile, reusedNames, redirectedReference, options).map(resolved => {
|
||||
// An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName.
|
||||
if (!resolved || (resolved as ResolvedModuleFull).extension !== undefined) {
|
||||
return resolved as ResolvedModuleFull;
|
||||
@@ -780,7 +780,7 @@ namespace ts {
|
||||
|
||||
let resolveTypeReferenceDirectiveNamesWorker: (typeDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference) => (ResolvedTypeReferenceDirective | undefined)[];
|
||||
if (host.resolveTypeReferenceDirectives) {
|
||||
resolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference) => host.resolveTypeReferenceDirectives!(Debug.assertEachDefined(typeDirectiveNames), containingFile, redirectedReference);
|
||||
resolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference) => host.resolveTypeReferenceDirectives!(Debug.assertEachDefined(typeDirectiveNames), containingFile, redirectedReference, options);
|
||||
}
|
||||
else {
|
||||
const loader = (typesRef: string, containingFile: string, redirectedReference: ResolvedProjectReference | undefined) => resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference).resolvedTypeReferenceDirective!; // TODO: GH#18217
|
||||
@@ -814,7 +814,10 @@ namespace ts {
|
||||
let mapFromFileToProjectReferenceRedirects: Map<Path> | undefined;
|
||||
|
||||
const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
|
||||
const structuralIsReused = tryReuseStructureFromOldProgram();
|
||||
// We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks
|
||||
// `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`.
|
||||
let structuralIsReused: StructureIsReused | undefined;
|
||||
structuralIsReused = tryReuseStructureFromOldProgram();
|
||||
if (structuralIsReused !== StructureIsReused.Completely) {
|
||||
processingDefaultLibFiles = [];
|
||||
processingOtherFiles = [];
|
||||
|
||||
+124
-27
File diff suppressed because one or more lines are too long
+61
-3
@@ -304,6 +304,53 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export function createSingleFileWatcherPerName(
|
||||
watchFile: HostWatchFile,
|
||||
useCaseSensitiveFileNames: boolean
|
||||
): HostWatchFile {
|
||||
interface SingleFileWatcher {
|
||||
watcher: FileWatcher;
|
||||
refCount: number;
|
||||
}
|
||||
const cache = createMap<SingleFileWatcher>();
|
||||
const callbacksCache = createMultiMap<FileWatcherCallback>();
|
||||
const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
|
||||
|
||||
return (fileName, callback, pollingInterval) => {
|
||||
const path = toCanonicalFileName(fileName);
|
||||
const existing = cache.get(path);
|
||||
if (existing) {
|
||||
existing.refCount++;
|
||||
}
|
||||
else {
|
||||
cache.set(path, {
|
||||
watcher: watchFile(
|
||||
fileName,
|
||||
(fileName, eventKind) => forEach(
|
||||
callbacksCache.get(path),
|
||||
cb => cb(fileName, eventKind)
|
||||
),
|
||||
pollingInterval
|
||||
),
|
||||
refCount: 1
|
||||
});
|
||||
}
|
||||
callbacksCache.add(path, callback);
|
||||
|
||||
return {
|
||||
close: () => {
|
||||
const watcher = Debug.assertDefined(cache.get(path));
|
||||
callbacksCache.remove(path, callback);
|
||||
watcher.refCount--;
|
||||
if (watcher.refCount) return;
|
||||
cache.delete(path);
|
||||
closeFileWatcherOf(watcher);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if file status changed
|
||||
*/
|
||||
@@ -695,6 +742,7 @@ namespace ts {
|
||||
const useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER;
|
||||
const tscWatchFile = process.env.TSC_WATCHFILE;
|
||||
const tscWatchDirectory = process.env.TSC_WATCHDIRECTORY;
|
||||
const fsWatchFile = createSingleFileWatcherPerName(fsWatchFileWorker, useCaseSensitiveFileNames);
|
||||
let dynamicPollingWatchFile: HostWatchFile | undefined;
|
||||
const nodeSystem: System = {
|
||||
args: process.argv.slice(2),
|
||||
@@ -835,7 +883,7 @@ namespace ts {
|
||||
return useNonPollingWatchers ?
|
||||
createNonPollingWatchFile() :
|
||||
// Default to do not use polling interval as it is before this experiment branch
|
||||
(fileName, callback) => fsWatchFile(fileName, callback);
|
||||
(fileName, callback) => fsWatchFile(fileName, callback, /*pollingInterval*/ undefined);
|
||||
}
|
||||
|
||||
function getWatchDirectory(): HostWatchDirectory {
|
||||
@@ -916,7 +964,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function fsWatchFile(fileName: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher {
|
||||
function fsWatchFileWorker(fileName: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher {
|
||||
_fs.watchFile(fileName, { persistent: true, interval: pollingInterval || 250 }, fileChanged);
|
||||
let eventKind: FileWatcherEventKind;
|
||||
return {
|
||||
@@ -1086,7 +1134,7 @@ namespace ts {
|
||||
return (directoryName, callback) => fsWatchFile(directoryName, () => callback(directoryName), PollingInterval.Medium);
|
||||
}
|
||||
|
||||
function readFile(fileName: string, _encoding?: string): string | undefined {
|
||||
function readFileWorker(fileName: string, _encoding?: string): string | undefined {
|
||||
if (!fileExists(fileName)) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -1115,7 +1163,15 @@ namespace ts {
|
||||
return buffer.toString("utf8");
|
||||
}
|
||||
|
||||
function readFile(fileName: string, _encoding?: string): string | undefined {
|
||||
perfLogger.logStartReadFile(fileName);
|
||||
const file = readFileWorker(fileName, _encoding);
|
||||
perfLogger.logStopReadFile();
|
||||
return file;
|
||||
}
|
||||
|
||||
function writeFile(fileName: string, data: string, writeByteOrderMark?: boolean): void {
|
||||
perfLogger.logEvent("WriteFile: " + fileName);
|
||||
// If a BOM is required, emit one
|
||||
if (writeByteOrderMark) {
|
||||
data = byteOrderMarkIndicator + data;
|
||||
@@ -1135,6 +1191,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getAccessibleFileSystemEntries(path: string): FileSystemEntries {
|
||||
perfLogger.logEvent("ReadDir: " + (path || "."));
|
||||
try {
|
||||
const entries = _fs.readdirSync(path || ".").sort();
|
||||
const files: string[] = [];
|
||||
@@ -1196,6 +1253,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getDirectories(path: string): string[] {
|
||||
perfLogger.logEvent("ReadDir: " + path);
|
||||
return filter<string>(_fs.readdirSync(path), dir => fileSystemEntryExists(combinePaths(path, dir), FileSystemEntryKind.Directory));
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ namespace ts {
|
||||
let currentSourceFile: SourceFile;
|
||||
let refs: Map<SourceFile>;
|
||||
let libs: Map<boolean>;
|
||||
let emittedImports: readonly AnyImportSyntax[] | undefined; // must be declared in container so it can be `undefined` while transformer's first pass
|
||||
const resolver = context.getEmitResolver();
|
||||
const options = context.getCompilerOptions();
|
||||
const newLine = getNewLineCharacter(options);
|
||||
@@ -279,7 +280,7 @@ namespace ts {
|
||||
const statements = visitNodes(node.statements, visitDeclarationStatements);
|
||||
let combinedStatements = setTextRange(createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements);
|
||||
refs.forEach(referenceVisitor);
|
||||
const emittedImports = filter(combinedStatements, isAnyImportSyntax);
|
||||
emittedImports = filter(combinedStatements, isAnyImportSyntax);
|
||||
if (isExternalModule(node) && (!resultHasExternalModuleIndicator || (needsScopeFixMarker && !resultHasScopeMarker))) {
|
||||
combinedStatements = setTextRange(createNodeArray([...combinedStatements, createEmptyExports()]), combinedStatements);
|
||||
}
|
||||
@@ -736,6 +737,12 @@ namespace ts {
|
||||
}
|
||||
const oldDiag = getSymbolAccessibilityDiagnostic;
|
||||
|
||||
// Setup diagnostic-related flags before first potential `cleanup` call, otherwise
|
||||
// We'd see a TDZ violation at runtime
|
||||
const canProduceDiagnostic = canProduceDiagnostics(input);
|
||||
const oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
|
||||
let shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === SyntaxKind.TypeLiteral || input.kind === SyntaxKind.MappedType) && input.parent.kind !== SyntaxKind.TypeAliasDeclaration);
|
||||
|
||||
// Emit methods which are private as properties with no type information
|
||||
if (isMethodDeclaration(input) || isMethodSignature(input)) {
|
||||
if (hasModifier(input, ModifierFlags.Private)) {
|
||||
@@ -744,8 +751,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
const canProdiceDiagnostic = canProduceDiagnostics(input);
|
||||
if (canProdiceDiagnostic && !suppressNewDiagnosticContexts) {
|
||||
if (canProduceDiagnostic && !suppressNewDiagnosticContexts) {
|
||||
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(input as DeclarationDiagnosticProducing);
|
||||
}
|
||||
|
||||
@@ -753,8 +759,6 @@ namespace ts {
|
||||
checkEntityNameVisibility(input.exprName, enclosingDeclaration);
|
||||
}
|
||||
|
||||
const oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
|
||||
let shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === SyntaxKind.TypeLiteral || input.kind === SyntaxKind.MappedType) && input.parent.kind !== SyntaxKind.TypeAliasDeclaration);
|
||||
if (shouldEnterSuppressNewDiagnosticsContextContext) {
|
||||
// We stop making new diagnostic contexts within object literal types. Unless it's an object type on the RHS of a type alias declaration. Then we do.
|
||||
suppressNewDiagnosticContexts = true;
|
||||
@@ -909,13 +913,13 @@ namespace ts {
|
||||
return cleanup(visitEachChild(input, visitDeclarationSubtree, context));
|
||||
|
||||
function cleanup<T extends Node>(returnValue: T | undefined): T | undefined {
|
||||
if (returnValue && canProdiceDiagnostic && hasDynamicName(input as Declaration)) {
|
||||
if (returnValue && canProduceDiagnostic && hasDynamicName(input as Declaration)) {
|
||||
checkName(input as DeclarationDiagnosticProducing);
|
||||
}
|
||||
if (isEnclosingDeclaration(input)) {
|
||||
enclosingDeclaration = previousEnclosingDeclaration;
|
||||
}
|
||||
if (canProdiceDiagnostic && !suppressNewDiagnosticContexts) {
|
||||
if (canProduceDiagnostic && !suppressNewDiagnosticContexts) {
|
||||
getSymbolAccessibilityDiagnostic = oldDiag;
|
||||
}
|
||||
if (shouldEnterSuppressNewDiagnosticsContextContext) {
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace ts {
|
||||
const previousOnSubstituteNode = context.onSubstituteNode;
|
||||
context.onSubstituteNode = onSubstituteNode;
|
||||
|
||||
let exportedVariableStatement = false;
|
||||
let enabledSubstitutions: ESNextSubstitutionFlags;
|
||||
let enclosingFunctionFlags: FunctionFlags;
|
||||
let enclosingSuperContainerFlags: NodeCheckFlags = 0;
|
||||
@@ -40,6 +41,7 @@ namespace ts {
|
||||
return node;
|
||||
}
|
||||
|
||||
exportedVariableStatement = false;
|
||||
const visited = visitEachChild(node, visitor, context);
|
||||
addEmitHelpers(visited, context.readEmitHelpers());
|
||||
return visited;
|
||||
@@ -79,6 +81,8 @@ namespace ts {
|
||||
return visitBinaryExpression(node as BinaryExpression, noDestructuringValue);
|
||||
case SyntaxKind.CatchClause:
|
||||
return visitCatchClause(node as CatchClause);
|
||||
case SyntaxKind.VariableStatement:
|
||||
return visitVariableStatement(node as VariableStatement);
|
||||
case SyntaxKind.VariableDeclaration:
|
||||
return visitVariableDeclaration(node as VariableDeclaration);
|
||||
case SyntaxKind.ForOfStatement:
|
||||
@@ -321,19 +325,43 @@ namespace ts {
|
||||
return visitEachChild(node, visitor, context);
|
||||
}
|
||||
|
||||
function visitVariableStatement(node: VariableStatement): VisitResult<VariableStatement> {
|
||||
if (hasModifier(node, ModifierFlags.Export)) {
|
||||
const savedExportedVariableStatement = exportedVariableStatement;
|
||||
exportedVariableStatement = true;
|
||||
const visited = visitEachChild(node, visitor, context);
|
||||
exportedVariableStatement = savedExportedVariableStatement;
|
||||
return visited;
|
||||
}
|
||||
return visitEachChild(node, visitor, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits a VariableDeclaration node with a binding pattern.
|
||||
*
|
||||
* @param node A VariableDeclaration node.
|
||||
*/
|
||||
function visitVariableDeclaration(node: VariableDeclaration): VisitResult<VariableDeclaration> {
|
||||
if (exportedVariableStatement) {
|
||||
const savedExportedVariableStatement = exportedVariableStatement;
|
||||
exportedVariableStatement = false;
|
||||
const visited = visitVariableDeclarationWorker(node, /*exportedVariableStatement*/ true);
|
||||
exportedVariableStatement = savedExportedVariableStatement;
|
||||
return visited;
|
||||
}
|
||||
return visitVariableDeclarationWorker(node, /*exportedVariableStatement*/ false);
|
||||
}
|
||||
|
||||
function visitVariableDeclarationWorker(node: VariableDeclaration, exportedVariableStatement: boolean): VisitResult<VariableDeclaration> {
|
||||
// If we are here it is because the name contains a binding pattern with a rest somewhere in it.
|
||||
if (isBindingPattern(node.name) && node.name.transformFlags & TransformFlags.ContainsObjectRestOrSpread) {
|
||||
return flattenDestructuringBinding(
|
||||
node,
|
||||
visitor,
|
||||
context,
|
||||
FlattenLevel.ObjectRest
|
||||
FlattenLevel.ObjectRest,
|
||||
/*rval*/ undefined,
|
||||
exportedVariableStatement
|
||||
);
|
||||
}
|
||||
return visitEachChild(node, visitor, context);
|
||||
|
||||
+45
-2
@@ -564,8 +564,51 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getBuildOrder(state: SolutionBuilderState) {
|
||||
return state.buildOrder ||
|
||||
(state.buildOrder = createBuildOrder(state, state.rootNames.map(f => resolveProjectName(state, f))));
|
||||
return state.buildOrder || createStateBuildOrder(state);
|
||||
}
|
||||
|
||||
function createStateBuildOrder(state: SolutionBuilderState) {
|
||||
const buildOrder = createBuildOrder(state, state.rootNames.map(f => resolveProjectName(state, f)));
|
||||
if (arrayIsEqualTo(state.buildOrder, buildOrder)) return state.buildOrder!;
|
||||
|
||||
// Clear all to ResolvedConfigFilePaths cache to start fresh
|
||||
state.resolvedConfigFilePaths.clear();
|
||||
const currentProjects = arrayToSet(
|
||||
buildOrder,
|
||||
resolved => toResolvedConfigFilePath(state, resolved)
|
||||
) as ConfigFileMap<true>;
|
||||
|
||||
const noopOnDelete = { onDeleteValue: noop };
|
||||
// Config file cache
|
||||
mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete);
|
||||
mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete);
|
||||
mutateMapSkippingNewValues(state.buildInfoChecked, currentProjects, noopOnDelete);
|
||||
mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete);
|
||||
mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete);
|
||||
mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete);
|
||||
mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
|
||||
|
||||
// Remove watches for the program no longer in the solution
|
||||
if (state.watch) {
|
||||
mutateMapSkippingNewValues(
|
||||
state.allWatchedConfigFiles,
|
||||
currentProjects,
|
||||
{ onDeleteValue: closeFileWatcher }
|
||||
);
|
||||
|
||||
mutateMapSkippingNewValues(
|
||||
state.allWatchedWildcardDirectories,
|
||||
currentProjects,
|
||||
{ onDeleteValue: existingMap => existingMap.forEach(closeFileWatcherOf) }
|
||||
);
|
||||
|
||||
mutateMapSkippingNewValues(
|
||||
state.allWatchedInputFiles,
|
||||
currentProjects,
|
||||
{ onDeleteValue: existingMap => existingMap.forEach(closeFileWatcher) }
|
||||
);
|
||||
}
|
||||
return state.buildOrder = buildOrder;
|
||||
}
|
||||
|
||||
function getBuildOrderFor(state: SolutionBuilderState, project: string | undefined, onlyReferences: boolean | undefined) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"core.ts",
|
||||
"debug.ts",
|
||||
"performance.ts",
|
||||
"perfLogger.ts",
|
||||
"semver.ts",
|
||||
|
||||
"types.ts",
|
||||
|
||||
@@ -3687,8 +3687,8 @@ namespace ts {
|
||||
|
||||
Enum = RegularEnum | ConstEnum,
|
||||
Variable = FunctionScopedVariable | BlockScopedVariable,
|
||||
Value = Variable | Property | EnumMember | ObjectLiteral | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor | Assignment,
|
||||
Type = Class | Interface | Enum | EnumMember | TypeLiteral | TypeParameter | TypeAlias | Assignment,
|
||||
Value = Variable | Property | EnumMember | ObjectLiteral | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor,
|
||||
Type = Class | Interface | Enum | EnumMember | TypeLiteral | TypeParameter | TypeAlias,
|
||||
Namespace = ValueModule | NamespaceModule | Enum,
|
||||
Module = ValueModule | NamespaceModule,
|
||||
Accessor = GetAccessor | SetAccessor,
|
||||
@@ -3709,7 +3709,7 @@ namespace ts {
|
||||
InterfaceExcludes = Type & ~(Interface | Class),
|
||||
RegularEnumExcludes = (Value | Type) & ~(RegularEnum | ValueModule), // regular enums merge only with regular enums and modules
|
||||
ConstEnumExcludes = (Value | Type) & ~ConstEnum, // const enums merge only with const enums
|
||||
ValueModuleExcludes = Value & ~(Function | Class | RegularEnum | ValueModule | Assignment),
|
||||
ValueModuleExcludes = Value & ~(Function | Class | RegularEnum | ValueModule),
|
||||
NamespaceModuleExcludes = 0,
|
||||
MethodExcludes = Value & ~Method,
|
||||
GetAccessorExcludes = Value & ~SetAccessor,
|
||||
@@ -5199,11 +5199,11 @@ namespace ts {
|
||||
* If resolveModuleNames is implemented then implementation for members from ModuleResolutionHost can be just
|
||||
* 'throw new Error("NotImplemented")'
|
||||
*/
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModule | undefined)[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
|
||||
/**
|
||||
* This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
|
||||
*/
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
getEnvironmentVariable?(name: string): string | undefined;
|
||||
/* @internal */ onReleaseOldSourceFile?(oldSourceFile: SourceFile, oldOptions: CompilerOptions, hasSourceFileByPath: boolean): void;
|
||||
/* @internal */ hasInvalidatedResolution?: HasInvalidatedResolution;
|
||||
|
||||
@@ -566,6 +566,8 @@ namespace ts {
|
||||
return emitNode && emitNode.flags || 0;
|
||||
}
|
||||
|
||||
const escapeNoSubstitutionTemplateLiteralText = compose(escapeString, escapeTemplateSubstitution);
|
||||
const escapeNonAsciiNoSubstitutionTemplateLiteralText = compose(escapeNonAsciiString, escapeTemplateSubstitution);
|
||||
export function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile, neverAsciiEscape: boolean | undefined) {
|
||||
// If we don't need to downlevel and we can reach the original source text using
|
||||
// the node's parent reference, then simply get the text as it was originally written.
|
||||
@@ -576,7 +578,11 @@ namespace ts {
|
||||
return getSourceTextOfNodeFromSourceFile(sourceFile, node);
|
||||
}
|
||||
|
||||
const escapeText = neverAsciiEscape || (getEmitFlags(node) & EmitFlags.NoAsciiEscaping) ? escapeString : escapeNonAsciiString;
|
||||
// If a NoSubstitutionTemplateLiteral appears to have a substitution in it, the original text
|
||||
// had to include a backslash: `not \${a} substitution`.
|
||||
const escapeText = neverAsciiEscape || (getEmitFlags(node) & EmitFlags.NoAsciiEscaping) ?
|
||||
node.kind === SyntaxKind.NoSubstitutionTemplateLiteral ? escapeNoSubstitutionTemplateLiteralText : escapeString :
|
||||
node.kind === SyntaxKind.NoSubstitutionTemplateLiteral ? escapeNonAsciiNoSubstitutionTemplateLiteralText : escapeNonAsciiString;
|
||||
|
||||
// If we can't reach the original source text, use the canonical form if it's a number,
|
||||
// or a (possibly escaped) quoted form of the original text if it's string-like.
|
||||
@@ -3113,6 +3119,11 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
const templateSubstitutionRegExp = /\$\{/g;
|
||||
function escapeTemplateSubstitution(str: string): string {
|
||||
return str.replace(templateSubstitutionRegExp, "\\${");
|
||||
}
|
||||
|
||||
// This consists of the first 19 unprintable ASCII characters, canonical escapes, lineSeparator,
|
||||
// paragraphSeparator, and nextLine. The latter three are just desirable to suppress new lines in
|
||||
// the language service. These characters should be escaped when printing, and if any characters are added,
|
||||
@@ -4466,8 +4477,7 @@ namespace ts {
|
||||
map.clear();
|
||||
}
|
||||
|
||||
export interface MutateMapOptions<T, U> {
|
||||
createNewValue(key: string, valueInNewMap: U): T;
|
||||
export interface MutateMapSkippingNewValuesOptions<T, U> {
|
||||
onDeleteValue(existingValue: T, key: string): void;
|
||||
|
||||
/**
|
||||
@@ -4482,8 +4492,12 @@ namespace ts {
|
||||
/**
|
||||
* Mutates the map with newMap such that keys in map will be same as newMap.
|
||||
*/
|
||||
export function mutateMap<T, U>(map: Map<T>, newMap: ReadonlyMap<U>, options: MutateMapOptions<T, U>) {
|
||||
const { createNewValue, onDeleteValue, onExistingValue } = options;
|
||||
export function mutateMapSkippingNewValues<T, U>(
|
||||
map: Map<T>,
|
||||
newMap: ReadonlyMap<U>,
|
||||
options: MutateMapSkippingNewValuesOptions<T, U>
|
||||
) {
|
||||
const { onDeleteValue, onExistingValue } = options;
|
||||
// Needs update
|
||||
map.forEach((existingValue, key) => {
|
||||
const valueInNewMap = newMap.get(key);
|
||||
@@ -4497,7 +4511,20 @@ namespace ts {
|
||||
onExistingValue(existingValue, valueInNewMap, key);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export interface MutateMapOptions<T, U> extends MutateMapSkippingNewValuesOptions<T, U> {
|
||||
createNewValue(key: string, valueInNewMap: U): T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mutates the map with newMap such that keys in map will be same as newMap.
|
||||
*/
|
||||
export function mutateMap<T, U>(map: Map<T>, newMap: ReadonlyMap<U>, options: MutateMapOptions<T, U>) {
|
||||
// Needs update
|
||||
mutateMapSkippingNewValues(map, newMap, options);
|
||||
|
||||
const { createNewValue } = options;
|
||||
// Add new values that are not already present
|
||||
newMap.forEach((valueInNewMap, key) => {
|
||||
if (!map.has(key)) {
|
||||
@@ -5108,7 +5135,10 @@ namespace ts {
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.ExpressionStatement:
|
||||
const expr = hostNode.expression;
|
||||
let expr = hostNode.expression;
|
||||
if (expr.kind === SyntaxKind.BinaryExpression && (expr as BinaryExpression).operatorToken.kind === SyntaxKind.EqualsToken) {
|
||||
expr = (expr as BinaryExpression).left;
|
||||
}
|
||||
switch (expr.kind) {
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
return (expr as PropertyAccessExpression).name;
|
||||
|
||||
+13
-7
@@ -538,9 +538,9 @@ namespace ts {
|
||||
getEnvironmentVariable?(name: string): string | undefined;
|
||||
|
||||
/** If provided, used to resolve the module names, otherwise typescript's default module resolution */
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModule | undefined)[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
|
||||
/** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
}
|
||||
/** Internal interface used to wire emit through same host */
|
||||
|
||||
@@ -744,10 +744,10 @@ namespace ts {
|
||||
);
|
||||
// Resolve module using host module resolution strategy if provided otherwise use resolution cache to resolve module names
|
||||
compilerHost.resolveModuleNames = host.resolveModuleNames ?
|
||||
((moduleNames, containingFile, reusedNames, redirectedReference) => host.resolveModuleNames!(moduleNames, containingFile, reusedNames, redirectedReference)) :
|
||||
((...args) => host.resolveModuleNames!(...args)) :
|
||||
((moduleNames, containingFile, reusedNames, redirectedReference) => resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference));
|
||||
compilerHost.resolveTypeReferenceDirectives = host.resolveTypeReferenceDirectives ?
|
||||
((typeDirectiveNames, containingFile, redirectedReference) => host.resolveTypeReferenceDirectives!(typeDirectiveNames, containingFile, redirectedReference)) :
|
||||
((...args) => host.resolveTypeReferenceDirectives!(...args)) :
|
||||
((typeDirectiveNames, containingFile, redirectedReference) => resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference));
|
||||
const userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
||||
|
||||
@@ -1005,13 +1005,19 @@ namespace ts {
|
||||
|
||||
switch (reloadLevel) {
|
||||
case ConfigFileProgramReloadLevel.Partial:
|
||||
return reloadFileNamesFromConfigFile();
|
||||
perfLogger.logStartUpdateProgram("PartialConfigReload");
|
||||
reloadFileNamesFromConfigFile();
|
||||
break;
|
||||
case ConfigFileProgramReloadLevel.Full:
|
||||
return reloadConfigFile();
|
||||
perfLogger.logStartUpdateProgram("FullConfigReload");
|
||||
reloadConfigFile();
|
||||
break;
|
||||
default:
|
||||
perfLogger.logStartUpdateProgram("SynchronizeProgram");
|
||||
synchronizeProgram();
|
||||
return;
|
||||
break;
|
||||
}
|
||||
perfLogger.logStopUpdateProgram("Done");
|
||||
}
|
||||
|
||||
function reloadFileNamesFromConfigFile() {
|
||||
|
||||
@@ -344,7 +344,8 @@ namespace FourSlash {
|
||||
"getDocumentHighlights",
|
||||
];
|
||||
const proxy = {} as ts.LanguageService;
|
||||
for (const k in ls) {
|
||||
const keys = ts.getAllKeys(ls);
|
||||
for (const k of keys) {
|
||||
const key = k as keyof typeof ls;
|
||||
if (cacheableMembers.indexOf(key) === -1) {
|
||||
proxy[key] = (...args: any[]) => (ls[key] as Function)(...args);
|
||||
@@ -2321,7 +2322,10 @@ namespace FourSlash {
|
||||
public applyCodeActionFromCompletion(markerName: string, options: FourSlashInterface.VerifyCompletionActionOptions) {
|
||||
this.goToMarker(markerName);
|
||||
|
||||
const details = this.getCompletionEntryDetails(options.name, options.source, options.preferences)!;
|
||||
const details = this.getCompletionEntryDetails(options.name, options.source, options.preferences);
|
||||
if (!details) {
|
||||
return this.raiseError(`No completions were found for the given name, source, and preferences.`);
|
||||
}
|
||||
const codeActions = details.codeActions!;
|
||||
if (codeActions.length !== 1) {
|
||||
this.raiseError(`Expected one code action, got ${codeActions.length}`);
|
||||
@@ -2430,7 +2434,7 @@ namespace FourSlash {
|
||||
const oldText = this.tryGetFileContent(change.fileName);
|
||||
ts.Debug.assert(!!change.isNewFile === (oldText === undefined));
|
||||
const newContent = change.isNewFile ? ts.first(change.textChanges).newText : ts.textChanges.applyChanges(oldText!, change.textChanges);
|
||||
assert.equal(newContent, expectedNewContent);
|
||||
assert.equal(newContent, expectedNewContent, `String mis-matched in file ${change.fileName}`);
|
||||
}
|
||||
for (const newFileName in newFileContent) {
|
||||
ts.Debug.assert(changes.some(c => c.fileName === newFileName), "No change in file", () => newFileName);
|
||||
|
||||
@@ -726,6 +726,7 @@ namespace Harness {
|
||||
includeBuiltFile?: string;
|
||||
baselineFile?: string;
|
||||
libFiles?: string;
|
||||
noTypesAndSymbols?: boolean;
|
||||
}
|
||||
|
||||
// Additional options not already in ts.optionDeclarations
|
||||
@@ -742,6 +743,7 @@ namespace Harness {
|
||||
{ name: "currentDirectory", type: "string" },
|
||||
{ name: "symlink", type: "string" },
|
||||
{ name: "link", type: "string" },
|
||||
{ name: "noTypesAndSymbols", type: "boolean" },
|
||||
// Emitted js baseline will print full paths for every output file
|
||||
{ name: "fullEmitPaths", type: "boolean" }
|
||||
];
|
||||
|
||||
+24
-2
@@ -1525,8 +1525,11 @@ namespace vfs {
|
||||
return typeof value === "string" || Buffer.isBuffer(value) ? new File(value) : new Directory(value);
|
||||
}
|
||||
|
||||
export function formatPatch(patch: FileSet) {
|
||||
return formatPatchWorker("", patch);
|
||||
export function formatPatch(patch: FileSet): string;
|
||||
export function formatPatch(patch: FileSet | undefined): string | null;
|
||||
export function formatPatch(patch: FileSet | undefined) {
|
||||
// tslint:disable-next-line:no-null-keyword
|
||||
return patch ? formatPatchWorker("", patch) : null;
|
||||
}
|
||||
|
||||
function formatPatchWorker(dirname: string, container: FileSet): string {
|
||||
@@ -1559,5 +1562,24 @@ namespace vfs {
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
export function iteratePatch(patch: FileSet | undefined): IterableIterator<[string, string]> | null {
|
||||
// tslint:disable-next-line:no-null-keyword
|
||||
return patch ? Harness.Compiler.iterateOutputs(iteratePatchWorker("", patch)) : null;
|
||||
}
|
||||
|
||||
function* iteratePatchWorker(dirname: string, container: FileSet): IterableIterator<documents.TextDocument> {
|
||||
for (const name of Object.keys(container)) {
|
||||
const entry = normalizeFileSetEntry(container[name]);
|
||||
const file = dirname ? vpath.combine(dirname, name) : name;
|
||||
if (entry instanceof Directory) {
|
||||
yield* ts.arrayFrom(iteratePatchWorker(file, entry.files));
|
||||
}
|
||||
else if (entry instanceof File) {
|
||||
const content = typeof entry.data === "string" ? entry.data : entry.data.toString("utf8");
|
||||
yield new documents.TextDocument(file, content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// tslint:enable:no-null-keyword
|
||||
@@ -314,6 +314,11 @@ interface Array<T> {}`
|
||||
invokeFileDeleteCreateAsPartInsteadOfChange: boolean;
|
||||
}
|
||||
|
||||
export enum Tsc_WatchFile {
|
||||
DynamicPolling = "DynamicPriorityPolling",
|
||||
SingleFileWatcherPerName = "SingleFileWatcherPerName"
|
||||
}
|
||||
|
||||
export enum Tsc_WatchDirectory {
|
||||
WatchFile = "RecursiveDirectoryUsingFsWatchFile",
|
||||
NonRecursiveWatchDirectory = "RecursiveDirectoryUsingNonRecursiveWatchDirectory",
|
||||
@@ -339,7 +344,7 @@ interface Array<T> {}`
|
||||
readonly watchedFiles = createMultiMap<TestFileWatcher>();
|
||||
private readonly executingFilePath: string;
|
||||
private readonly currentDirectory: string;
|
||||
private readonly dynamicPriorityWatchFile: HostWatchFile | undefined;
|
||||
private readonly customWatchFile: HostWatchFile | undefined;
|
||||
private readonly customRecursiveWatchDirectory: HostWatchDirectory | undefined;
|
||||
public require: ((initialPath: string, moduleName: string) => server.RequireResult) | undefined;
|
||||
|
||||
@@ -349,9 +354,23 @@ interface Array<T> {}`
|
||||
this.executingFilePath = this.getHostSpecificPath(executingFilePath);
|
||||
this.currentDirectory = this.getHostSpecificPath(currentDirectory);
|
||||
this.reloadFS(fileOrFolderorSymLinkList);
|
||||
this.dynamicPriorityWatchFile = this.environmentVariables && this.environmentVariables.get("TSC_WATCHFILE") === "DynamicPriorityPolling" ?
|
||||
createDynamicPriorityPollingWatchFile(this) :
|
||||
undefined;
|
||||
const tscWatchFile = this.environmentVariables && this.environmentVariables.get("TSC_WATCHFILE") as Tsc_WatchFile;
|
||||
switch (tscWatchFile) {
|
||||
case Tsc_WatchFile.DynamicPolling:
|
||||
this.customWatchFile = createDynamicPriorityPollingWatchFile(this);
|
||||
break;
|
||||
case Tsc_WatchFile.SingleFileWatcherPerName:
|
||||
this.customWatchFile = createSingleFileWatcherPerName(
|
||||
this.watchFileWorker.bind(this),
|
||||
this.useCaseSensitiveFileNames
|
||||
);
|
||||
break;
|
||||
case undefined:
|
||||
break;
|
||||
default:
|
||||
Debug.assertNever(tscWatchFile);
|
||||
}
|
||||
|
||||
const tscWatchDirectory = this.environmentVariables && this.environmentVariables.get("TSC_WATCHDIRECTORY") as Tsc_WatchDirectory;
|
||||
if (tscWatchDirectory === Tsc_WatchDirectory.WatchFile) {
|
||||
const watchDirectory: HostWatchDirectory = (directory, cb) => this.watchFile(directory, () => cb(directory), PollingInterval.Medium);
|
||||
@@ -405,7 +424,7 @@ interface Array<T> {}`
|
||||
return s;
|
||||
}
|
||||
|
||||
private now() {
|
||||
now() {
|
||||
this.time += timeIncrements;
|
||||
return new Date(this.time);
|
||||
}
|
||||
@@ -854,10 +873,14 @@ interface Array<T> {}`
|
||||
}
|
||||
|
||||
watchFile(fileName: string, cb: FileWatcherCallback, pollingInterval: number) {
|
||||
if (this.dynamicPriorityWatchFile) {
|
||||
return this.dynamicPriorityWatchFile(fileName, cb, pollingInterval);
|
||||
if (this.customWatchFile) {
|
||||
return this.customWatchFile(fileName, cb, pollingInterval);
|
||||
}
|
||||
|
||||
return this.watchFileWorker(fileName, cb);
|
||||
}
|
||||
|
||||
private watchFileWorker(fileName: string, cb: FileWatcherCallback) {
|
||||
const path = this.toFullPath(fileName);
|
||||
const callback: TestFileWatcher = { fileName, cb };
|
||||
this.watchedFiles.add(path, callback);
|
||||
|
||||
@@ -851,6 +851,7 @@ namespace ts.server {
|
||||
* @returns: true if set of files in the project stays the same and false - otherwise.
|
||||
*/
|
||||
updateGraph(): boolean {
|
||||
perfLogger.logStartUpdateGraph();
|
||||
this.resolutionCache.startRecordingFilesWithChangedResolutions();
|
||||
|
||||
const hasNewProgram = this.updateGraphWorker();
|
||||
@@ -886,6 +887,7 @@ namespace ts.server {
|
||||
if (hasNewProgram) {
|
||||
this.projectProgramVersion++;
|
||||
}
|
||||
perfLogger.logStopUpdateGraph();
|
||||
return !hasNewProgram;
|
||||
}
|
||||
|
||||
@@ -1275,7 +1277,7 @@ namespace ts.server {
|
||||
private enableProxy(pluginModuleFactory: PluginModuleFactory, configEntry: PluginImport) {
|
||||
try {
|
||||
if (typeof pluginModuleFactory !== "function") {
|
||||
this.projectService.logger.info(`Skipped loading plugin ${configEntry.name} because it did expose a proper factory function`);
|
||||
this.projectService.logger.info(`Skipped loading plugin ${configEntry.name} because it did not expose a proper factory function`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+31
-9
@@ -42,6 +42,11 @@ namespace ts.server {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function dtsChangeCanAffectEmit(compilationSettings: CompilerOptions) {
|
||||
return getEmitDeclarations(compilationSettings) || !!compilationSettings.emitDecoratorMetadata;
|
||||
}
|
||||
|
||||
function formatDiag(fileName: NormalizedPath, project: Project, diag: Diagnostic): protocol.Diagnostic {
|
||||
const scriptInfo = project.getScriptInfoForNormalizedPath(fileName)!; // TODO: GH#18217
|
||||
return {
|
||||
@@ -731,7 +736,9 @@ namespace ts.server {
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.host.write(formatMessage(msg, this.logger, this.byteLength, this.host.newLine));
|
||||
const msgText = formatMessage(msg, this.logger, this.byteLength, this.host.newLine);
|
||||
perfLogger.logEvent(`Response message size: ${msgText.length}`);
|
||||
this.host.write(msgText);
|
||||
}
|
||||
|
||||
public event<T extends object>(body: T, eventName: string): void {
|
||||
@@ -1604,15 +1611,22 @@ namespace ts.server {
|
||||
path => this.projectService.getScriptInfoForPath(path)!,
|
||||
projects,
|
||||
(project, info) => {
|
||||
let result: protocol.CompileOnSaveAffectedFileListSingleProject | undefined;
|
||||
if (project.compileOnSaveEnabled && project.languageServiceEnabled && !project.isOrphan() && !project.getCompilationSettings().noEmit) {
|
||||
result = {
|
||||
projectFileName: project.getProjectName(),
|
||||
fileNames: project.getCompileOnSaveAffectedFileList(info),
|
||||
projectUsesOutFile: !!project.getCompilationSettings().outFile || !!project.getCompilationSettings().out
|
||||
};
|
||||
if (!project.compileOnSaveEnabled || !project.languageServiceEnabled || project.isOrphan()) {
|
||||
return undefined;
|
||||
}
|
||||
return result;
|
||||
|
||||
const compilationSettings = project.getCompilationSettings();
|
||||
|
||||
if (!!compilationSettings.noEmit || fileExtensionIs(info.fileName, Extension.Dts) && !dtsChangeCanAffectEmit(compilationSettings)) {
|
||||
// avoid triggering emit when a change is made in a .d.ts when declaration emit and decorator metadata emit are disabled
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
projectFileName: project.getProjectName(),
|
||||
fileNames: project.getCompileOnSaveAffectedFileList(info),
|
||||
projectUsesOutFile: !!compilationSettings.outFile || !!compilationSettings.out
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -2509,6 +2523,8 @@ namespace ts.server {
|
||||
try {
|
||||
request = <protocol.Request>JSON.parse(message);
|
||||
relevantFile = request.arguments && (request as protocol.FileRequest).arguments.file ? (request as protocol.FileRequest).arguments : undefined;
|
||||
|
||||
perfLogger.logStartCommand("" + request.command, message.substring(0, 100));
|
||||
const { response, responseRequired } = this.executeCommand(request);
|
||||
|
||||
if (this.logger.hasLevel(LogLevel.requestTime)) {
|
||||
@@ -2521,6 +2537,8 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
// Note: Log before writing the response, else the editor can complete its activity before the server does
|
||||
perfLogger.logStopCommand("" + request.command, "Success");
|
||||
if (response) {
|
||||
this.doOutput(response, request.command, request.seq, /*success*/ true);
|
||||
}
|
||||
@@ -2531,10 +2549,14 @@ namespace ts.server {
|
||||
catch (err) {
|
||||
if (err instanceof OperationCanceledException) {
|
||||
// Handle cancellation exceptions
|
||||
perfLogger.logStopCommand("" + (request && request.command), "Canceled: " + err);
|
||||
this.doOutput({ canceled: true }, request!.command, request!.seq, /*success*/ true);
|
||||
return;
|
||||
}
|
||||
|
||||
this.logErrorWorker(err, message, relevantFile);
|
||||
perfLogger.logStopCommand("" + (request && request.command), "Error: " + err);
|
||||
|
||||
this.doOutput(
|
||||
/*info*/ undefined,
|
||||
request ? request.command : CommandNames.Unknown,
|
||||
|
||||
@@ -150,11 +150,13 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
private static run(self: ThrottledOperations, operationId: string, cb: () => void) {
|
||||
perfLogger.logStartScheduledOperation(operationId);
|
||||
self.pendingTimeouts.delete(operationId);
|
||||
if (self.logger) {
|
||||
self.logger.info(`Running: ${operationId}`);
|
||||
}
|
||||
cb();
|
||||
perfLogger.logStopScheduledOperation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,6 +176,7 @@ namespace ts.server {
|
||||
private static run(self: GcTimer) {
|
||||
self.timerId = undefined;
|
||||
|
||||
perfLogger.logStartScheduledOperation("GC collect");
|
||||
const log = self.logger.hasLevel(LogLevel.requestTime);
|
||||
const before = log && self.host.getMemoryUsage!(); // TODO: GH#18217
|
||||
|
||||
@@ -182,6 +185,7 @@ namespace ts.server {
|
||||
const after = self.host.getMemoryUsage!(); // TODO: GH#18217
|
||||
self.logger.perftrc(`GC::before ${before}, after ${after}`);
|
||||
}
|
||||
perfLogger.logStopScheduledOperation();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -683,6 +683,11 @@ namespace ts {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (kind === SyntaxKind.SingleLineCommentTrivia) {
|
||||
if (tryClassifyTripleSlashComment(start, width)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Simple comment. Just add as is.
|
||||
pushCommentRange(start, width);
|
||||
@@ -755,6 +760,84 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function tryClassifyTripleSlashComment(start: number, width: number): boolean {
|
||||
const tripleSlashXMLCommentRegEx = /^(\/\/\/\s*)(<)(?:(\S+)((?:[^/]|\/[^>])*)(\/>)?)?/im;
|
||||
const attributeRegex = /(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/img;
|
||||
|
||||
const text = sourceFile.text.substr(start, width);
|
||||
const match = tripleSlashXMLCommentRegEx.exec(text);
|
||||
if (!match) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let pos = start;
|
||||
|
||||
pushCommentRange(pos, match[1].length); // ///
|
||||
pos += match[1].length;
|
||||
|
||||
pushClassification(pos, match[2].length, ClassificationType.punctuation); // <
|
||||
pos += match[2].length;
|
||||
|
||||
if (!match[3]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
pushClassification(pos, match[3].length, ClassificationType.jsxSelfClosingTagName); // element name
|
||||
pos += match[3].length;
|
||||
|
||||
const attrText = match[4];
|
||||
let attrPos = pos;
|
||||
while (true) {
|
||||
const attrMatch = attributeRegex.exec(attrText);
|
||||
if (!attrMatch) {
|
||||
break;
|
||||
}
|
||||
|
||||
const newAttrPos = pos + attrMatch.index;
|
||||
if (newAttrPos > attrPos) {
|
||||
pushCommentRange(attrPos, newAttrPos - attrPos);
|
||||
attrPos = newAttrPos;
|
||||
}
|
||||
|
||||
pushClassification(attrPos, attrMatch[1].length, ClassificationType.jsxAttribute); // attribute name
|
||||
attrPos += attrMatch[1].length;
|
||||
|
||||
if (attrMatch[2].length) {
|
||||
pushCommentRange(attrPos, attrMatch[2].length); // whitespace
|
||||
attrPos += attrMatch[2].length;
|
||||
}
|
||||
|
||||
pushClassification(attrPos, attrMatch[3].length, ClassificationType.operator); // =
|
||||
attrPos += attrMatch[3].length;
|
||||
|
||||
if (attrMatch[4].length) {
|
||||
pushCommentRange(attrPos, attrMatch[4].length); // whitespace
|
||||
attrPos += attrMatch[4].length;
|
||||
}
|
||||
|
||||
pushClassification(attrPos, attrMatch[5].length, ClassificationType.jsxAttributeStringLiteralValue); // attribute value
|
||||
attrPos += attrMatch[5].length;
|
||||
}
|
||||
|
||||
pos += match[4].length;
|
||||
|
||||
if (pos > attrPos) {
|
||||
pushCommentRange(attrPos, pos - attrPos);
|
||||
}
|
||||
|
||||
if (match[5]) {
|
||||
pushClassification(pos, match[5].length, ClassificationType.punctuation); // />
|
||||
pos += match[5].length;
|
||||
}
|
||||
|
||||
const end = start + width;
|
||||
if (pos < end) {
|
||||
pushCommentRange(pos, end - pos);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function processJSDocTemplateTag(tag: JSDocTemplateTag) {
|
||||
for (const child of tag.getChildren()) {
|
||||
processElement(child);
|
||||
|
||||
@@ -135,7 +135,8 @@ namespace ts.codefix {
|
||||
Named,
|
||||
Default,
|
||||
Namespace,
|
||||
Equals
|
||||
Equals,
|
||||
ConstEquals
|
||||
}
|
||||
|
||||
/** Information about how a symbol is exported from a module. (We don't need to store the exported symbol, just its module.) */
|
||||
@@ -163,7 +164,7 @@ namespace ts.codefix {
|
||||
position: number,
|
||||
preferences: UserPreferences,
|
||||
): { readonly moduleSpecifier: string, readonly codeAction: CodeAction } {
|
||||
const exportInfos = getAllReExportingModules(exportedSymbol, moduleSymbol, symbolName, sourceFile, program.getCompilerOptions(), program.getTypeChecker(), program.getSourceFiles());
|
||||
const exportInfos = getAllReExportingModules(sourceFile, exportedSymbol, moduleSymbol, symbolName, sourceFile, program.getCompilerOptions(), program.getTypeChecker(), program.getSourceFiles());
|
||||
Debug.assert(exportInfos.some(info => info.moduleSymbol === moduleSymbol));
|
||||
// We sort the best codefixes first, so taking `first` is best for completions.
|
||||
const moduleSpecifier = first(getNewImportInfos(program, sourceFile, position, exportInfos, host, preferences)).moduleSpecifier;
|
||||
@@ -175,7 +176,7 @@ namespace ts.codefix {
|
||||
return { description, changes, commands };
|
||||
}
|
||||
|
||||
function getAllReExportingModules(exportedSymbol: Symbol, exportingModuleSymbol: Symbol, symbolName: string, sourceFile: SourceFile, compilerOptions: CompilerOptions, checker: TypeChecker, allSourceFiles: ReadonlyArray<SourceFile>): ReadonlyArray<SymbolExportInfo> {
|
||||
function getAllReExportingModules(importingFile: SourceFile, exportedSymbol: Symbol, exportingModuleSymbol: Symbol, symbolName: string, sourceFile: SourceFile, compilerOptions: CompilerOptions, checker: TypeChecker, allSourceFiles: ReadonlyArray<SourceFile>): ReadonlyArray<SymbolExportInfo> {
|
||||
const result: SymbolExportInfo[] = [];
|
||||
forEachExternalModule(checker, allSourceFiles, (moduleSymbol, moduleFile) => {
|
||||
// Don't import from a re-export when looking "up" like to `./index` or `../index`.
|
||||
@@ -183,7 +184,7 @@ namespace ts.codefix {
|
||||
return;
|
||||
}
|
||||
|
||||
const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions);
|
||||
const defaultInfo = getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions);
|
||||
if (defaultInfo && defaultInfo.name === symbolName && skipAlias(defaultInfo.symbol, checker) === exportedSymbol) {
|
||||
result.push({ moduleSymbol, importKind: defaultInfo.kind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(defaultInfo.symbol, checker) });
|
||||
}
|
||||
@@ -329,7 +330,7 @@ namespace ts.codefix {
|
||||
if (!umdSymbol) return undefined;
|
||||
const symbol = checker.getAliasedSymbol(umdSymbol);
|
||||
const symbolName = umdSymbol.name;
|
||||
const exportInfos: ReadonlyArray<SymbolExportInfo> = [{ moduleSymbol: symbol, importKind: getUmdImportKind(program.getCompilerOptions()), exportedSymbolIsTypeOnly: false }];
|
||||
const exportInfos: ReadonlyArray<SymbolExportInfo> = [{ moduleSymbol: symbol, importKind: getUmdImportKind(sourceFile, program.getCompilerOptions()), exportedSymbolIsTypeOnly: false }];
|
||||
const fixes = getFixForImport(exportInfos, symbolName, isIdentifier(token) ? token.getStart(sourceFile) : undefined, program, sourceFile, host, preferences);
|
||||
return { fixes, symbolName };
|
||||
}
|
||||
@@ -345,7 +346,7 @@ namespace ts.codefix {
|
||||
: undefined;
|
||||
}
|
||||
|
||||
function getUmdImportKind(compilerOptions: CompilerOptions): ImportKind {
|
||||
function getUmdImportKind(importingFile: SourceFile, compilerOptions: CompilerOptions): ImportKind {
|
||||
// Import a synthetic `default` if enabled.
|
||||
if (getAllowSyntheticDefaultImports(compilerOptions)) {
|
||||
return ImportKind.Default;
|
||||
@@ -357,7 +358,10 @@ namespace ts.codefix {
|
||||
case ModuleKind.AMD:
|
||||
case ModuleKind.CommonJS:
|
||||
case ModuleKind.UMD:
|
||||
return ImportKind.Equals;
|
||||
if (isInJSFile(importingFile)) {
|
||||
return isExternalModule(importingFile) ? ImportKind.Namespace : ImportKind.ConstEquals;
|
||||
}
|
||||
return ImportKind.Equals;
|
||||
case ModuleKind.System:
|
||||
case ModuleKind.ES2015:
|
||||
case ModuleKind.ESNext:
|
||||
@@ -403,7 +407,7 @@ namespace ts.codefix {
|
||||
forEachExternalModuleToImportFrom(checker, sourceFile, program.getSourceFiles(), moduleSymbol => {
|
||||
cancellationToken.throwIfCancellationRequested();
|
||||
|
||||
const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, program.getCompilerOptions());
|
||||
const defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, program.getCompilerOptions());
|
||||
if (defaultInfo && defaultInfo.name === symbolName && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) {
|
||||
addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind);
|
||||
}
|
||||
@@ -418,20 +422,41 @@ namespace ts.codefix {
|
||||
}
|
||||
|
||||
function getDefaultLikeExportInfo(
|
||||
moduleSymbol: Symbol, checker: TypeChecker, compilerOptions: CompilerOptions,
|
||||
): { readonly symbol: Symbol, readonly symbolForMeaning: Symbol, readonly name: string, readonly kind: ImportKind.Default | ImportKind.Equals } | undefined {
|
||||
const exported = getDefaultLikeExportWorker(moduleSymbol, checker);
|
||||
importingFile: SourceFile, moduleSymbol: Symbol, checker: TypeChecker, compilerOptions: CompilerOptions,
|
||||
): { readonly symbol: Symbol, readonly symbolForMeaning: Symbol, readonly name: string, readonly kind: ImportKind } | undefined {
|
||||
const exported = getDefaultLikeExportWorker(importingFile, moduleSymbol, checker, compilerOptions);
|
||||
if (!exported) return undefined;
|
||||
const { symbol, kind } = exported;
|
||||
const info = getDefaultExportInfoWorker(symbol, moduleSymbol, checker, compilerOptions);
|
||||
return info && { symbol, kind, ...info };
|
||||
}
|
||||
|
||||
function getDefaultLikeExportWorker(moduleSymbol: Symbol, checker: TypeChecker): { readonly symbol: Symbol, readonly kind: ImportKind.Default | ImportKind.Equals } | undefined {
|
||||
function getDefaultLikeExportWorker(importingFile: SourceFile, moduleSymbol: Symbol, checker: TypeChecker, compilerOptions: CompilerOptions): { readonly symbol: Symbol, readonly kind: ImportKind } | undefined {
|
||||
const defaultExport = checker.tryGetMemberInModuleExports(InternalSymbolName.Default, moduleSymbol);
|
||||
if (defaultExport) return { symbol: defaultExport, kind: ImportKind.Default };
|
||||
const exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol);
|
||||
return exportEquals === moduleSymbol ? undefined : { symbol: exportEquals, kind: ImportKind.Equals };
|
||||
return exportEquals === moduleSymbol ? undefined : { symbol: exportEquals, kind: getExportEqualsImportKind(importingFile, compilerOptions, checker) };
|
||||
}
|
||||
|
||||
function getExportEqualsImportKind(importingFile: SourceFile, compilerOptions: CompilerOptions, checker: TypeChecker): ImportKind {
|
||||
if (getAllowSyntheticDefaultImports(compilerOptions) && getEmitModuleKind(compilerOptions) >= ModuleKind.ES2015) {
|
||||
return ImportKind.Default;
|
||||
}
|
||||
if (isInJSFile(importingFile)) {
|
||||
return isExternalModule(importingFile) ? ImportKind.Default : ImportKind.ConstEquals;
|
||||
}
|
||||
for (const statement of importingFile.statements) {
|
||||
if (isImportEqualsDeclaration(statement)) {
|
||||
return ImportKind.Equals;
|
||||
}
|
||||
if (isImportDeclaration(statement) && statement.importClause && statement.importClause.name) {
|
||||
const moduleSymbol = checker.getImmediateAliasedSymbol(statement.importClause.symbol);
|
||||
if (moduleSymbol && moduleSymbol.name !== InternalSymbolName.Default) {
|
||||
return ImportKind.Default;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ImportKind.Equals;
|
||||
}
|
||||
|
||||
function getDefaultExportInfoWorker(defaultExport: Symbol, moduleSymbol: Symbol, checker: TypeChecker, compilerOptions: CompilerOptions): { readonly symbolForMeaning: Symbol, readonly name: string } | undefined {
|
||||
@@ -543,7 +568,10 @@ namespace ts.codefix {
|
||||
interface ImportsCollection {
|
||||
readonly defaultImport: string | undefined;
|
||||
readonly namedImports: string[];
|
||||
readonly namespaceLikeImport: { readonly importKind: ImportKind.Equals | ImportKind.Namespace, readonly name: string } | undefined;
|
||||
readonly namespaceLikeImport: {
|
||||
readonly importKind: ImportKind.Equals | ImportKind.Namespace | ImportKind.ConstEquals;
|
||||
readonly name: string;
|
||||
} | undefined;
|
||||
}
|
||||
function addNewImports(changes: textChanges.ChangeTracker, sourceFile: SourceFile, moduleSpecifier: string, quotePreference: QuotePreference, { defaultImport, namedImports, namespaceLikeImport }: ImportsCollection): void {
|
||||
const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference);
|
||||
@@ -554,12 +582,25 @@ namespace ts.codefix {
|
||||
namedImports.map(n => createImportSpecifier(/*propertyName*/ undefined, createIdentifier(n))), moduleSpecifier, quotePreference));
|
||||
}
|
||||
if (namespaceLikeImport) {
|
||||
insertImport(changes, sourceFile, namespaceLikeImport.importKind === ImportKind.Equals
|
||||
? createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createIdentifier(namespaceLikeImport.name), createExternalModuleReference(quotedModuleSpecifier))
|
||||
: createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createImportClause(/*name*/ undefined, createNamespaceImport(createIdentifier(namespaceLikeImport.name))), quotedModuleSpecifier));
|
||||
insertImport(
|
||||
changes,
|
||||
sourceFile,
|
||||
namespaceLikeImport.importKind === ImportKind.Equals ? createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createIdentifier(namespaceLikeImport.name), createExternalModuleReference(quotedModuleSpecifier)) :
|
||||
namespaceLikeImport.importKind === ImportKind.ConstEquals ? createConstEqualsRequireDeclaration(namespaceLikeImport.name, quotedModuleSpecifier) :
|
||||
createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createImportClause(/*name*/ undefined, createNamespaceImport(createIdentifier(namespaceLikeImport.name))), quotedModuleSpecifier));
|
||||
}
|
||||
}
|
||||
|
||||
function createConstEqualsRequireDeclaration(name: string, quotedModuleSpecifier: StringLiteral): VariableStatement {
|
||||
return createVariableStatement(/*modifiers*/ undefined, createVariableDeclarationList([
|
||||
createVariableDeclaration(
|
||||
createIdentifier(name),
|
||||
/*type*/ undefined,
|
||||
createCall(createIdentifier("require"), /*typeArguments*/ undefined, [quotedModuleSpecifier])
|
||||
)
|
||||
], NodeFlags.Const));
|
||||
}
|
||||
|
||||
function symbolHasMeaning({ declarations }: Symbol, meaning: SemanticMeaning): boolean {
|
||||
return some(declarations, decl => !!(getMeaningFromDeclaration(decl) & meaning));
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace ts.DocumentHighlights {
|
||||
|
||||
function getNodesToSearchForModifier(declaration: Node, modifierFlag: ModifierFlags): ReadonlyArray<Node> | undefined {
|
||||
// Types of node whose children might have modifiers.
|
||||
const container = declaration.parent as ModuleBlock | SourceFile | Block | CaseClause | DefaultClause | ConstructorDeclaration | MethodDeclaration | FunctionDeclaration | ClassLikeDeclaration;
|
||||
const container = declaration.parent as ModuleBlock | SourceFile | Block | CaseClause | DefaultClause | ConstructorDeclaration | MethodDeclaration | FunctionDeclaration | ObjectTypeDeclaration;
|
||||
switch (container.kind) {
|
||||
case SyntaxKind.ModuleBlock:
|
||||
case SyntaxKind.SourceFile:
|
||||
@@ -213,11 +213,13 @@ namespace ts.DocumentHighlights {
|
||||
return [...container.parameters, ...(isClassLike(container.parent) ? container.parent.members : [])];
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.ClassExpression:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.TypeLiteral:
|
||||
const nodes = container.members;
|
||||
|
||||
// If we're an accessibility modifier, we're in an instance member and should search
|
||||
// the constructor's parameter list for instance members as well.
|
||||
if (modifierFlag & ModifierFlags.AccessibilityModifier) {
|
||||
if (modifierFlag & (ModifierFlags.AccessibilityModifier | ModifierFlags.Readonly)) {
|
||||
const constructor = find(container.members, isConstructorDeclaration);
|
||||
if (constructor) {
|
||||
return [...nodes, ...constructor.parameters];
|
||||
|
||||
@@ -709,10 +709,28 @@ namespace ts.FindAllReferences.Core {
|
||||
return references.length ? [{ definition: { type: DefinitionKind.Symbol, symbol }, references }] : emptyArray;
|
||||
}
|
||||
|
||||
/** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */
|
||||
function isReadonlyTypeOperator(node: Node): boolean {
|
||||
return node.kind === SyntaxKind.ReadonlyKeyword
|
||||
&& isTypeOperatorNode(node.parent)
|
||||
&& node.parent.operator === SyntaxKind.ReadonlyKeyword;
|
||||
}
|
||||
|
||||
/** getReferencedSymbols for special node kinds. */
|
||||
function getReferencedSymbolsSpecial(node: Node, sourceFiles: ReadonlyArray<SourceFile>, cancellationToken: CancellationToken): SymbolAndEntries[] | undefined {
|
||||
if (isTypeKeyword(node.kind)) {
|
||||
return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken);
|
||||
// A modifier readonly (like on a property declaration) is not special;
|
||||
// a readonly type keyword (like `readonly string[]`) is.
|
||||
if (node.kind === SyntaxKind.ReadonlyKeyword && !isReadonlyTypeOperator(node)) {
|
||||
return undefined;
|
||||
}
|
||||
// Likewise, when we *are* looking for a special keyword, make sure we
|
||||
// *don’t* include readonly member modifiers.
|
||||
return getAllReferencesForKeyword(
|
||||
sourceFiles,
|
||||
node.kind,
|
||||
cancellationToken,
|
||||
node.kind === SyntaxKind.ReadonlyKeyword ? isReadonlyTypeOperator : undefined);
|
||||
}
|
||||
|
||||
// Labels
|
||||
@@ -1235,11 +1253,14 @@ namespace ts.FindAllReferences.Core {
|
||||
}
|
||||
}
|
||||
|
||||
function getAllReferencesForKeyword(sourceFiles: ReadonlyArray<SourceFile>, keywordKind: SyntaxKind, cancellationToken: CancellationToken): SymbolAndEntries[] | undefined {
|
||||
function getAllReferencesForKeyword(sourceFiles: ReadonlyArray<SourceFile>, keywordKind: SyntaxKind, cancellationToken: CancellationToken, filter?: (node: Node) => boolean): SymbolAndEntries[] | undefined {
|
||||
const references = flatMap(sourceFiles, sourceFile => {
|
||||
cancellationToken.throwIfCancellationRequested();
|
||||
return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, tokenToString(keywordKind)!, sourceFile), referenceLocation =>
|
||||
referenceLocation.kind === keywordKind ? nodeEntry(referenceLocation) : undefined);
|
||||
return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, tokenToString(keywordKind)!, sourceFile), referenceLocation => {
|
||||
if (referenceLocation.kind === keywordKind && (!filter || filter(referenceLocation))) {
|
||||
return nodeEntry(referenceLocation);
|
||||
}
|
||||
});
|
||||
});
|
||||
return references.length ? [{ definition: { type: DefinitionKind.Keyword, node: references[0].node }, references }] : undefined;
|
||||
}
|
||||
|
||||
@@ -233,20 +233,23 @@ namespace ts.GoToDefinition {
|
||||
}
|
||||
|
||||
function getDefinitionFromSymbol(typeChecker: TypeChecker, symbol: Symbol, node: Node): DefinitionInfo[] | undefined {
|
||||
return getConstructSignatureDefinition() || getCallSignatureDefinition() || map(symbol.declarations, declaration => createDefinitionInfo(declaration, typeChecker, symbol, node));
|
||||
// There are cases when you extend a function by adding properties to it afterwards,
|
||||
// we want to strip those extra properties
|
||||
const filteredDeclarations = filter(symbol.declarations, d => !isAssignmentDeclaration(d) || d === symbol.valueDeclaration) || undefined;
|
||||
return getConstructSignatureDefinition() || getCallSignatureDefinition() || map(filteredDeclarations, declaration => createDefinitionInfo(declaration, typeChecker, symbol, node));
|
||||
|
||||
function getConstructSignatureDefinition(): DefinitionInfo[] | undefined {
|
||||
// Applicable only if we are in a new expression, or we are on a constructor declaration
|
||||
// and in either case the symbol has a construct signature definition, i.e. class
|
||||
if (symbol.flags & SymbolFlags.Class && (isNewExpressionTarget(node) || node.kind === SyntaxKind.ConstructorKeyword)) {
|
||||
const cls = find(symbol.declarations, isClassLike) || Debug.fail("Expected declaration to have at least one class-like declaration");
|
||||
const cls = find(filteredDeclarations, isClassLike) || Debug.fail("Expected declaration to have at least one class-like declaration");
|
||||
return getSignatureDefinition(cls.members, /*selectConstructors*/ true);
|
||||
}
|
||||
}
|
||||
|
||||
function getCallSignatureDefinition(): DefinitionInfo[] | undefined {
|
||||
return isCallOrNewExpressionTarget(node) || isNameOfFunctionDeclaration(node)
|
||||
? getSignatureDefinition(symbol.declarations, /*selectConstructors*/ false)
|
||||
? getSignatureDefinition(filteredDeclarations, /*selectConstructors*/ false)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -434,7 +434,7 @@ namespace ts.FindAllReferences {
|
||||
/**
|
||||
* Given a local reference, we might notice that it's an import/export and recursively search for references of that.
|
||||
* If at an import, look locally for the symbol it imports.
|
||||
* If an an export, look for all imports of it.
|
||||
* If at an export, look for all imports of it.
|
||||
* This doesn't handle export specifiers; that is done in `getReferencesAtExportSpecifier`.
|
||||
* @param comingFromExport If we are doing a search for all exports, don't bother looking backwards for the imported symbol, since that's the reason we're here.
|
||||
*/
|
||||
@@ -577,10 +577,10 @@ namespace ts.FindAllReferences {
|
||||
// If a reference is a class expression, the exported node would be its parent.
|
||||
// If a reference is a variable declaration, the exported node would be the variable statement.
|
||||
function getExportNode(parent: Node, node: Node): Node | undefined {
|
||||
if (parent.kind === SyntaxKind.VariableDeclaration) {
|
||||
const p = parent as VariableDeclaration;
|
||||
return p.name !== node ? undefined :
|
||||
p.parent.kind === SyntaxKind.CatchClause ? undefined : p.parent.parent.kind === SyntaxKind.VariableStatement ? p.parent.parent : undefined;
|
||||
const declaration = isVariableDeclaration(parent) ? parent : isBindingElement(parent) ? walkUpBindingElementsAndPatterns(parent) : undefined;
|
||||
if (declaration) {
|
||||
return (parent as VariableDeclaration | BindingElement).name !== node ? undefined :
|
||||
isCatchClause(declaration.parent) ? undefined : isVariableStatement(declaration.parent.parent) ? declaration.parent.parent : undefined;
|
||||
}
|
||||
else {
|
||||
return parent;
|
||||
|
||||
@@ -350,7 +350,11 @@ namespace ts.refactor {
|
||||
}
|
||||
if (namedBindings) {
|
||||
if (namedBindingsUnused) {
|
||||
changes.delete(sourceFile, namedBindings);
|
||||
changes.replaceNode(
|
||||
sourceFile,
|
||||
importDecl.importClause,
|
||||
updateImportClause(importDecl.importClause, name, /*namedBindings*/ undefined)
|
||||
);
|
||||
}
|
||||
else if (namedBindings.kind === SyntaxKind.NamedImports) {
|
||||
for (const element of namedBindings.elements) {
|
||||
|
||||
@@ -1238,12 +1238,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (host.resolveModuleNames) {
|
||||
compilerHost.resolveModuleNames = (moduleNames, containingFile, reusedNames, redirectedReference) => host.resolveModuleNames!(moduleNames, containingFile, reusedNames, redirectedReference);
|
||||
compilerHost.resolveModuleNames = (...args) => host.resolveModuleNames!(...args);
|
||||
}
|
||||
if (host.resolveTypeReferenceDirectives) {
|
||||
compilerHost.resolveTypeReferenceDirectives = (typeReferenceDirectiveNames, containingFile, redirectedReference) => {
|
||||
return host.resolveTypeReferenceDirectives!(typeReferenceDirectiveNames, containingFile, redirectedReference);
|
||||
};
|
||||
compilerHost.resolveTypeReferenceDirectives = (...args) => host.resolveTypeReferenceDirectives!(...args);
|
||||
}
|
||||
|
||||
const documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace ts.SmartSelectionRange {
|
||||
break outer;
|
||||
}
|
||||
|
||||
if (positionShouldSnapToNode(pos, node, nextNode)) {
|
||||
if (positionShouldSnapToNode(sourceFile, pos, node)) {
|
||||
// 1. Blocks are effectively redundant with SyntaxLists.
|
||||
// 2. TemplateSpans, along with the SyntaxLists containing them, are a somewhat unintuitive grouping
|
||||
// of things that should be considered independently.
|
||||
@@ -97,12 +97,11 @@ namespace ts.SmartSelectionRange {
|
||||
* count too, unless that position belongs to the next node. In effect, makes
|
||||
* selections able to snap to preceding tokens when the cursor is on the tail
|
||||
* end of them with only whitespace ahead.
|
||||
* @param sourceFile The source file containing the nodes.
|
||||
* @param pos The position to check.
|
||||
* @param node The candidate node to snap to.
|
||||
* @param nextNode The next sibling node in the tree.
|
||||
* @param sourceFile The source file containing the nodes.
|
||||
*/
|
||||
function positionShouldSnapToNode(pos: number, node: Node, nextNode: Node | undefined) {
|
||||
function positionShouldSnapToNode(sourceFile: SourceFile, pos: number, node: Node) {
|
||||
// Can’t use 'ts.positionBelongsToNode()' here because it cleverly accounts
|
||||
// for missing nodes, which can’t really be considered when deciding what
|
||||
// to select.
|
||||
@@ -111,9 +110,8 @@ namespace ts.SmartSelectionRange {
|
||||
return true;
|
||||
}
|
||||
const nodeEnd = node.getEnd();
|
||||
const nextNodeStart = nextNode && nextNode.getStart();
|
||||
if (nodeEnd === pos) {
|
||||
return pos !== nextNodeStart;
|
||||
return getTouchingPropertyName(sourceFile, pos).pos < node.end;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -211,9 +211,9 @@ namespace ts {
|
||||
*
|
||||
* If this is implemented, `getResolvedModuleWithFailedLookupLocationsFromCache` should be too.
|
||||
*/
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModule | undefined)[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
|
||||
getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined;
|
||||
resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
/* @internal */ hasInvalidatedResolution?: HasInvalidatedResolution;
|
||||
/* @internal */ hasChangedAutomaticTypeDirectiveNames?: boolean;
|
||||
|
||||
|
||||
@@ -58,16 +58,18 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
}
|
||||
|
||||
public checkTestCodeOutput(fileName: string, test?: CompilerFileBasedTest) {
|
||||
if (test && test.configurations) {
|
||||
if (test && ts.some(test.configurations)) {
|
||||
test.configurations.forEach(configuration => {
|
||||
describe(`${this.testSuiteName} tests for ${fileName}${configuration ? ` (${Harness.getFileBasedTestConfigurationDescription(configuration)})` : ``}`, () => {
|
||||
this.runSuite(fileName, test, configuration);
|
||||
});
|
||||
});
|
||||
}
|
||||
describe(`${this.testSuiteName} tests for ${fileName}`, () => {
|
||||
this.runSuite(fileName, test);
|
||||
});
|
||||
else {
|
||||
describe(`${this.testSuiteName} tests for ${fileName}`, () => {
|
||||
this.runSuite(fileName, test);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private runSuite(fileName: string, test?: CompilerFileBasedTest, configuration?: Harness.FileBasedTestConfiguration) {
|
||||
@@ -112,6 +114,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
class CompilerTest {
|
||||
private fileName: string;
|
||||
private justName: string;
|
||||
private configuredName: string;
|
||||
private lastUnit: Harness.TestCaseParser.TestUnitData;
|
||||
private harnessSettings: Harness.TestCaseParser.CompilerSettings;
|
||||
private hasNonDtsFiles: boolean;
|
||||
@@ -126,6 +129,25 @@ class CompilerTest {
|
||||
constructor(fileName: string, testCaseContent?: Harness.TestCaseParser.TestCaseContent, configurationOverrides?: Harness.TestCaseParser.CompilerSettings) {
|
||||
this.fileName = fileName;
|
||||
this.justName = vpath.basename(fileName);
|
||||
this.configuredName = this.justName;
|
||||
if (configurationOverrides) {
|
||||
let configuredName = "";
|
||||
const keys = Object
|
||||
.keys(configurationOverrides)
|
||||
.map(k => k.toLowerCase())
|
||||
.sort();
|
||||
for (const key of keys) {
|
||||
if (configuredName) {
|
||||
configuredName += ",";
|
||||
}
|
||||
configuredName += `${key}=${configurationOverrides[key].toLowerCase()}`;
|
||||
}
|
||||
if (configuredName) {
|
||||
const extname = vpath.extname(this.justName);
|
||||
const basename = vpath.basename(this.justName, extname, /*ignoreCase*/ true);
|
||||
this.configuredName = `${basename}(${configuredName})${extname}`;
|
||||
}
|
||||
}
|
||||
|
||||
const rootDir = fileName.indexOf("conformance") === -1 ? "tests/cases/compiler/" : ts.getDirectoryPath(fileName) + "/";
|
||||
|
||||
@@ -205,7 +227,7 @@ class CompilerTest {
|
||||
public verifyDiagnostics() {
|
||||
// check errors
|
||||
Harness.Compiler.doErrorBaseline(
|
||||
this.justName,
|
||||
this.configuredName,
|
||||
this.tsConfigFiles.concat(this.toBeCompiled, this.otherFiles),
|
||||
this.result.diagnostics,
|
||||
!!this.options.pretty);
|
||||
@@ -213,7 +235,7 @@ class CompilerTest {
|
||||
|
||||
public verifyModuleResolution() {
|
||||
if (this.options.traceResolution) {
|
||||
Harness.Baseline.runBaseline(this.justName.replace(/\.tsx?$/, ".trace.json"),
|
||||
Harness.Baseline.runBaseline(this.configuredName.replace(/\.tsx?$/, ".trace.json"),
|
||||
JSON.stringify(this.result.traces.map(utils.sanitizeTraceResolutionLogEntry), undefined, 4));
|
||||
}
|
||||
}
|
||||
@@ -225,14 +247,14 @@ class CompilerTest {
|
||||
// Because of the noEmitOnError option no files are created. We need to return null because baselining isn't required.
|
||||
? null // tslint:disable-line no-null-keyword
|
||||
: record;
|
||||
Harness.Baseline.runBaseline(this.justName.replace(/\.tsx?$/, ".sourcemap.txt"), baseline);
|
||||
Harness.Baseline.runBaseline(this.configuredName.replace(/\.tsx?$/, ".sourcemap.txt"), baseline);
|
||||
}
|
||||
}
|
||||
|
||||
public verifyJavaScriptOutput() {
|
||||
if (this.hasNonDtsFiles) {
|
||||
Harness.Compiler.doJsEmitBaseline(
|
||||
this.justName,
|
||||
this.configuredName,
|
||||
this.fileName,
|
||||
this.options,
|
||||
this.result,
|
||||
@@ -245,7 +267,7 @@ class CompilerTest {
|
||||
|
||||
public verifySourceMapOutput() {
|
||||
Harness.Compiler.doSourcemapBaseline(
|
||||
this.justName,
|
||||
this.configuredName,
|
||||
this.options,
|
||||
this.result,
|
||||
this.harnessSettings);
|
||||
@@ -256,8 +278,15 @@ class CompilerTest {
|
||||
return;
|
||||
}
|
||||
|
||||
const noTypesAndSymbols =
|
||||
this.harnessSettings.noTypesAndSymbols &&
|
||||
this.harnessSettings.noTypesAndSymbols.toLowerCase() === "true";
|
||||
if (noTypesAndSymbols) {
|
||||
return;
|
||||
}
|
||||
|
||||
Harness.Compiler.doTypeAndSymbolBaseline(
|
||||
this.justName,
|
||||
this.configuredName,
|
||||
this.result.program!,
|
||||
this.toBeCompiled.concat(this.otherFiles).filter(file => !!this.result.program!.getSourceFile(file.unitName)),
|
||||
/*opts*/ undefined,
|
||||
|
||||
@@ -61,7 +61,6 @@
|
||||
"unittests/semver.ts",
|
||||
"unittests/shimMap.ts",
|
||||
"unittests/transform.ts",
|
||||
"unittests/tsbuildWatchMode.ts",
|
||||
"unittests/config/commandLineParsing.ts",
|
||||
"unittests/config/configurationExtension.ts",
|
||||
"unittests/config/convertCompilerOptionsFromJson.ts",
|
||||
@@ -75,6 +74,7 @@
|
||||
"unittests/evaluation/asyncGenerator.ts",
|
||||
"unittests/evaluation/awaiter.ts",
|
||||
"unittests/evaluation/forAwaitOf.ts",
|
||||
"unittests/evaluation/forOf.ts",
|
||||
"unittests/evaluation/objectRest.ts",
|
||||
"unittests/services/cancellableLanguageServiceOperations.ts",
|
||||
"unittests/services/colorization.ts",
|
||||
@@ -98,11 +98,14 @@
|
||||
"unittests/tsbuild/inferredTypeFromTransitiveModule.ts",
|
||||
"unittests/tsbuild/lateBoundSymbol.ts",
|
||||
"unittests/tsbuild/missingExtendedFile.ts",
|
||||
"unittests/tsbuild/moduleSpecifiers.ts",
|
||||
"unittests/tsbuild/outFile.ts",
|
||||
"unittests/tsbuild/referencesWithRootDirInParent.ts",
|
||||
"unittests/tsbuild/resolveJsonModule.ts",
|
||||
"unittests/tsbuild/sample.ts",
|
||||
"unittests/tsbuild/transitiveReferences.ts",
|
||||
"unittests/tsbuild/watchEnvironment.ts",
|
||||
"unittests/tsbuild/watchMode.ts",
|
||||
"unittests/tscWatch/consoleClearing.ts",
|
||||
"unittests/tscWatch/emit.ts",
|
||||
"unittests/tscWatch/emitAndErrorUpdates.ts",
|
||||
@@ -130,6 +133,7 @@
|
||||
"unittests/tsserver/formatSettings.ts",
|
||||
"unittests/tsserver/getApplicableRefactors.ts",
|
||||
"unittests/tsserver/getEditsForFileRename.ts",
|
||||
"unittests/tsserver/getExportReferences.ts",
|
||||
"unittests/tsserver/importHelpers.ts",
|
||||
"unittests/tsserver/inferredProjects.ts",
|
||||
"unittests/tsserver/languageService.ts",
|
||||
|
||||
@@ -348,5 +348,4 @@ namespace ts {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -53,6 +53,26 @@ namespace ts {
|
||||
|
||||
showTSConfigCorrectly("Show TSConfig with advanced options", ["--showConfig", "--declaration", "--declarationDir", "lib", "--skipLibCheck", "--noErrorTruncation"]);
|
||||
|
||||
showTSConfigCorrectly("Show TSConfig with compileOnSave and more", ["-p", "tsconfig.json"], {
|
||||
compilerOptions: {
|
||||
esModuleInterop: true,
|
||||
target: "es5",
|
||||
module: "commonjs",
|
||||
strict: true,
|
||||
},
|
||||
compileOnSave: true,
|
||||
exclude: [
|
||||
"dist"
|
||||
],
|
||||
files: [],
|
||||
include: [
|
||||
"src/*"
|
||||
],
|
||||
references: [
|
||||
{ path: "./test" }
|
||||
],
|
||||
});
|
||||
|
||||
// Regression test for https://github.com/Microsoft/TypeScript/issues/28836
|
||||
showTSConfigCorrectly("Show TSConfig with paths and more", ["-p", "tsconfig.json"], {
|
||||
compilerOptions: {
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
describe("unittests:: evaluation:: forOfEvaluation", () => {
|
||||
it("es5 over a array with no Symbol", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
Symbol = undefined;
|
||||
export var output = [];
|
||||
export function main() {
|
||||
let x = [1,2,3];
|
||||
|
||||
for (let value of x) {
|
||||
output.push(value);
|
||||
}
|
||||
}
|
||||
`, { downlevelIteration: true, target: ts.ScriptTarget.ES5 });
|
||||
|
||||
result.main();
|
||||
|
||||
assert.strictEqual(result.output[0], 1);
|
||||
assert.strictEqual(result.output[1], 2);
|
||||
assert.strictEqual(result.output[2], 3);
|
||||
|
||||
});
|
||||
|
||||
it("es5 over a string with no Symbol", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
Symbol = undefined;
|
||||
export var output = [];
|
||||
export function main() {
|
||||
let x = "hello";
|
||||
|
||||
for (let value of x) {
|
||||
output.push(value);
|
||||
}
|
||||
}
|
||||
`, { downlevelIteration: true, target: ts.ScriptTarget.ES5 });
|
||||
|
||||
result.main();
|
||||
|
||||
assert.strictEqual(result.output[0], "h");
|
||||
assert.strictEqual(result.output[1], "e");
|
||||
assert.strictEqual(result.output[2], "l");
|
||||
assert.strictEqual(result.output[3], "l");
|
||||
assert.strictEqual(result.output[4], "o");
|
||||
});
|
||||
|
||||
it("es5 over undefined with no Symbol", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
Symbol = undefined;
|
||||
export function main() {
|
||||
let x = undefined;
|
||||
|
||||
for (let value of x) {
|
||||
}
|
||||
}
|
||||
`, { downlevelIteration: true, target: ts.ScriptTarget.ES5 });
|
||||
|
||||
assert.throws(() => result.main(), "Symbol.iterator is not defined");
|
||||
});
|
||||
|
||||
it("es5 over undefined with Symbol", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
export function main() {
|
||||
let x = undefined;
|
||||
|
||||
for (let value of x) {
|
||||
}
|
||||
}
|
||||
`, { downlevelIteration: true, target: ts.ScriptTarget.ES5 });
|
||||
|
||||
assert.throws(() => result.main(), /cannot read property.*Symbol\(Symbol\.iterator\).*/i);
|
||||
});
|
||||
|
||||
it("es5 over object with no Symbol.iterator with no Symbol", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
Symbol = undefined;
|
||||
export function main() {
|
||||
let x = {} as any;
|
||||
|
||||
for (let value of x) {
|
||||
}
|
||||
}
|
||||
`, { downlevelIteration: true, target: ts.ScriptTarget.ES5 });
|
||||
|
||||
assert.throws(() => result.main(), "Symbol.iterator is not defined");
|
||||
});
|
||||
|
||||
it("es5 over object with no Symbol.iterator with Symbol", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
export function main() {
|
||||
let x = {} as any;
|
||||
|
||||
for (let value of x) {
|
||||
}
|
||||
}
|
||||
`, { downlevelIteration: true, target: ts.ScriptTarget.ES5 });
|
||||
|
||||
assert.throws(() => result.main(), "Object is not iterable");
|
||||
});
|
||||
|
||||
it("es5 over object with Symbol.iterator", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
export var output = [];
|
||||
export function main() {
|
||||
let thing : any = {};
|
||||
thing[Symbol.iterator] = () => {
|
||||
let i = 0;
|
||||
return { next() { i++; return this; }, value: i, done: i < 10 };
|
||||
};
|
||||
|
||||
for (let value of thing)
|
||||
{
|
||||
output.push(value)
|
||||
}
|
||||
|
||||
}`, { downlevelIteration: true, target: ts.ScriptTarget.ES5 });
|
||||
|
||||
result.main();
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,98 @@
|
||||
namespace ts {
|
||||
// https://github.com/microsoft/TypeScript/issues/31696
|
||||
it("unittests:: tsbuild:: moduleSpecifiers:: synthesized module specifiers to referenced projects resolve correctly", () => {
|
||||
const baseFs = vfs.createFromFileSystem(Harness.IO, /*ignoreCase*/ false, {
|
||||
files: {
|
||||
"/src/common/nominal.ts": utils.dedent`
|
||||
export declare type Nominal<T, Name extends string> = T & {
|
||||
[Symbol.species]: Name;
|
||||
};
|
||||
`,
|
||||
"/src/common/tsconfig.json": utils.dedent`
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
},
|
||||
"include": ["nominal.ts"]
|
||||
}`,
|
||||
"/src/sub-project/index.ts": utils.dedent`
|
||||
import { Nominal } from '../common/nominal';
|
||||
|
||||
export type MyNominal = Nominal<string, 'MyNominal'>;
|
||||
`,
|
||||
"/src/sub-project/tsconfig.json": utils.dedent`
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../common" }
|
||||
],
|
||||
"include": ["./index.ts"]
|
||||
}`,
|
||||
"/src/sub-project-2/index.ts": utils.dedent`
|
||||
import { MyNominal } from '../sub-project/index';
|
||||
|
||||
const variable = {
|
||||
key: 'value' as MyNominal,
|
||||
};
|
||||
|
||||
export function getVar(): keyof typeof variable {
|
||||
return 'key';
|
||||
}
|
||||
`,
|
||||
"/src/sub-project-2/tsconfig.json": utils.dedent`
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../sub-project" }
|
||||
],
|
||||
"include": ["./index.ts"]
|
||||
}`,
|
||||
"/src/tsconfig.json": utils.dedent`
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
},
|
||||
"references": [
|
||||
{ "path": "./sub-project" },
|
||||
{ "path": "./sub-project-2" }
|
||||
],
|
||||
"include": []
|
||||
}`,
|
||||
"/tsconfig.base.json": utils.dedent`
|
||||
{
|
||||
"compilerOptions": {
|
||||
"skipLibCheck": true,
|
||||
"rootDir": "./",
|
||||
"outDir": "lib",
|
||||
"lib": ["dom", "es2015", "es2015.symbol.wellknown"]
|
||||
}
|
||||
}`,
|
||||
"/tsconfig.json": utils.dedent`{
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
},
|
||||
"references": [
|
||||
{ "path": "./src" }
|
||||
],
|
||||
"include": []
|
||||
}`
|
||||
},
|
||||
cwd: "/"
|
||||
});
|
||||
const fs = baseFs.makeReadonly().shadow();
|
||||
const sys = new fakes.System(fs, { executingFilePath: "/", newLine: "\n" });
|
||||
const host = new fakes.SolutionBuilderHost(sys);
|
||||
const builder = createSolutionBuilder(host, ["/tsconfig.json"], { dry: false, force: false, verbose: false });
|
||||
builder.build();
|
||||
|
||||
// Prior to fixing GH31696 the import in `/lib/src/sub-project-2/index.d.ts` was `import("../../lib/src/common/nonterminal")`, which was invalid.
|
||||
Harness.Baseline.runBaseline("tsbuild/moduleSpecifiers/initial-build/resolves-correctly.js", vfs.formatPatch(fs.diff(baseFs)));
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
namespace ts.tscWatch {
|
||||
describe("unittests:: tsbuild:: watchEnvironment:: tsbuild:: watchMode:: with different watch environments", () => {
|
||||
describe("when watchFile can create multiple watchers per file", () => {
|
||||
verifyWatchFileOnMultipleProjects(/*singleWatchPerFile*/ false);
|
||||
});
|
||||
|
||||
describe("when watchFile is single watcher per file", () => {
|
||||
verifyWatchFileOnMultipleProjects(
|
||||
/*singleWatchPerFile*/ true,
|
||||
arrayToMap(["TSC_WATCHFILE"], identity, () => TestFSWithWatch.Tsc_WatchFile.SingleFileWatcherPerName)
|
||||
);
|
||||
});
|
||||
|
||||
function verifyWatchFileOnMultipleProjects(singleWatchPerFile: boolean, environmentVariables?: Map<string>) {
|
||||
it("watchFile on same file multiple times because file is part of multiple projects", () => {
|
||||
const project = `${TestFSWithWatch.tsbuildProjectsLocation}/myproject`;
|
||||
let maxPkgs = 4;
|
||||
const configPath = `${project}/tsconfig.json`;
|
||||
const typing: File = {
|
||||
path: `${project}/typings/xterm.d.ts`,
|
||||
content: "export const typing = 10;"
|
||||
};
|
||||
|
||||
const allPkgFiles = pkgs(pkgFiles);
|
||||
const system = createWatchedSystem([libFile, typing, ...flatArray(allPkgFiles)], { currentDirectory: project, environmentVariables });
|
||||
writePkgReferences();
|
||||
const host = createSolutionBuilderWithWatchHost(system);
|
||||
const solutionBuilder = createSolutionBuilderWithWatch(host, ["tsconfig.json"], { watch: true, verbose: true });
|
||||
solutionBuilder.build();
|
||||
checkOutputErrorsInitial(system, emptyArray, /*disableConsoleClears*/ undefined, [
|
||||
`Projects in this build: \r\n${
|
||||
concatenate(
|
||||
pkgs(index => ` * pkg${index}/tsconfig.json`),
|
||||
[" * tsconfig.json"]
|
||||
).join("\r\n")}\n\n`,
|
||||
...flatArray(pkgs(index => [
|
||||
`Project 'pkg${index}/tsconfig.json' is out of date because output file 'pkg${index}/index.js' does not exist\n\n`,
|
||||
`Building project '${project}/pkg${index}/tsconfig.json'...\n\n`
|
||||
]))
|
||||
]);
|
||||
|
||||
const watchFilesDetailed = arrayToMap(flatArray(allPkgFiles), f => f.path, () => 1);
|
||||
watchFilesDetailed.set(configPath, 1);
|
||||
watchFilesDetailed.set(typing.path, singleWatchPerFile ? 1 : maxPkgs);
|
||||
checkWatchedFilesDetailed(system, watchFilesDetailed);
|
||||
system.writeFile(typing.path, `${typing.content}export const typing1 = 10;`);
|
||||
verifyInvoke();
|
||||
|
||||
// Make change
|
||||
maxPkgs--;
|
||||
writePkgReferences();
|
||||
system.checkTimeoutQueueLengthAndRun(1);
|
||||
checkOutputErrorsIncremental(system, emptyArray);
|
||||
const lastFiles = last(allPkgFiles);
|
||||
lastFiles.forEach(f => watchFilesDetailed.delete(f.path));
|
||||
watchFilesDetailed.set(typing.path, singleWatchPerFile ? 1 : maxPkgs);
|
||||
checkWatchedFilesDetailed(system, watchFilesDetailed);
|
||||
system.writeFile(typing.path, typing.content);
|
||||
verifyInvoke();
|
||||
|
||||
// Make change to remove all the watches
|
||||
maxPkgs = 0;
|
||||
writePkgReferences();
|
||||
system.checkTimeoutQueueLengthAndRun(1);
|
||||
checkOutputErrorsIncremental(system, [
|
||||
`tsconfig.json(1,10): error TS18002: The 'files' list in config file '${configPath}' is empty.\n`
|
||||
]);
|
||||
checkWatchedFilesDetailed(system, [configPath], 1);
|
||||
|
||||
system.writeFile(typing.path, `${typing.content}export const typing1 = 10;`);
|
||||
system.checkTimeoutQueueLength(0);
|
||||
|
||||
function flatArray<T>(arr: T[][]): readonly T[] {
|
||||
return flatMap(arr, identity);
|
||||
}
|
||||
function pkgs<T>(cb: (index: number) => T): T[] {
|
||||
const result: T[] = [];
|
||||
for (let index = 0; index < maxPkgs; index++) {
|
||||
result.push(cb(index));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function createPkgReference(index: number) {
|
||||
return { path: `./pkg${index}` };
|
||||
}
|
||||
function pkgFiles(index: number): File[] {
|
||||
return [
|
||||
{
|
||||
path: `${project}/pkg${index}/index.ts`,
|
||||
content: `export const pkg${index} = ${index};`
|
||||
},
|
||||
{
|
||||
path: `${project}/pkg${index}/tsconfig.json`,
|
||||
content: JSON.stringify({
|
||||
complerOptions: { composite: true },
|
||||
include: [
|
||||
"**/*.ts",
|
||||
"../typings/xterm.d.ts"
|
||||
]
|
||||
})
|
||||
}
|
||||
];
|
||||
}
|
||||
function writePkgReferences() {
|
||||
system.writeFile(configPath, JSON.stringify({
|
||||
files: [],
|
||||
include: [],
|
||||
references: pkgs(createPkgReference)
|
||||
}));
|
||||
}
|
||||
function verifyInvoke() {
|
||||
pkgs(() => system.checkTimeoutQueueLengthAndRun(1));
|
||||
checkOutputErrorsIncremental(system, emptyArray, /*disableConsoleClears*/ undefined, /*logsBeforeWatchDiagnostics*/ undefined, [
|
||||
...flatArray(pkgs(index => [
|
||||
`Project 'pkg${index}/tsconfig.json' is out of date because oldest output 'pkg${index}/index.js' is older than newest input 'typings/xterm.d.ts'\n\n`,
|
||||
`Building project '${project}/pkg${index}/tsconfig.json'...\n\n`,
|
||||
`Updating unchanged output timestamps of project '${project}/pkg${index}/tsconfig.json'...\n\n`
|
||||
]))
|
||||
]);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
+58
-28
@@ -16,11 +16,19 @@ namespace ts.tscWatch {
|
||||
return host;
|
||||
}
|
||||
|
||||
|
||||
export function createSolutionBuilder(system: WatchedSystem, rootNames: ReadonlyArray<string>, defaultOptions?: BuildOptions) {
|
||||
const host = createSolutionBuilderHost(system);
|
||||
host.now = system.now.bind(system);
|
||||
return ts.createSolutionBuilder(host, rootNames, defaultOptions || {});
|
||||
}
|
||||
|
||||
export function createSolutionBuilderWithWatchHost(system: WatchedSystem) {
|
||||
const host = ts.createSolutionBuilderWithWatchHost(system);
|
||||
host.now = system.now.bind(system);
|
||||
return host;
|
||||
}
|
||||
|
||||
function createSolutionBuilderWithWatch(system: TsBuildWatchSystem, rootNames: ReadonlyArray<string>, defaultOptions?: BuildOptions) {
|
||||
const host = createSolutionBuilderWithWatchHost(system);
|
||||
const solutionBuilder = ts.createSolutionBuilderWithWatch(host, rootNames, defaultOptions || { watch: true });
|
||||
@@ -33,7 +41,7 @@ namespace ts.tscWatch {
|
||||
return [f, host.getModifiedTime(f), host.writtenFiles.has(host.toFullPath(f))] as OutputFileStamp;
|
||||
}
|
||||
|
||||
describe("unittests:: tsbuild-watch program updates", () => {
|
||||
describe("unittests:: tsbuild:: watchMode:: program updates", () => {
|
||||
const project = "sample1";
|
||||
const enum SubProject {
|
||||
core = "core",
|
||||
@@ -113,13 +121,33 @@ namespace ts.tscWatch {
|
||||
}
|
||||
}
|
||||
|
||||
const core = subProjectFiles(SubProject.core, /*anotherModuleAndSomeDecl*/ true);
|
||||
const logic = subProjectFiles(SubProject.logic);
|
||||
const tests = subProjectFiles(SubProject.tests);
|
||||
const ui = subProjectFiles(SubProject.ui);
|
||||
const allFiles: ReadonlyArray<File> = [libFile, ...core, ...logic, ...tests, ...ui];
|
||||
const testProjectExpectedWatchedFiles = [core[0], core[1], core[2]!, ...logic, ...tests].map(f => f.path.toLowerCase()); // tslint:disable-line no-unnecessary-type-assertion (TODO: type assertion should be necessary)
|
||||
const testProjectExpectedWatchedDirectoriesRecursive = [projectPath(SubProject.core), projectPath(SubProject.logic)];
|
||||
let core: SubProjectFiles;
|
||||
let logic: SubProjectFiles;
|
||||
let tests: SubProjectFiles;
|
||||
let ui: SubProjectFiles;
|
||||
let allFiles: ReadonlyArray<File>;
|
||||
let testProjectExpectedWatchedFiles: string[];
|
||||
let testProjectExpectedWatchedDirectoriesRecursive: string[];
|
||||
|
||||
before(() => {
|
||||
core = subProjectFiles(SubProject.core, /*anotherModuleAndSomeDecl*/ true);
|
||||
logic = subProjectFiles(SubProject.logic);
|
||||
tests = subProjectFiles(SubProject.tests);
|
||||
ui = subProjectFiles(SubProject.ui);
|
||||
allFiles = [libFile, ...core, ...logic, ...tests, ...ui];
|
||||
testProjectExpectedWatchedFiles = [core[0], core[1], core[2]!, ...logic, ...tests].map(f => f.path.toLowerCase()); // tslint:disable-line no-unnecessary-type-assertion (TODO: type assertion should be necessary)
|
||||
testProjectExpectedWatchedDirectoriesRecursive = [projectPath(SubProject.core), projectPath(SubProject.logic)];
|
||||
});
|
||||
|
||||
after(() => {
|
||||
core = undefined!;
|
||||
logic = undefined!;
|
||||
tests = undefined!;
|
||||
ui = undefined!;
|
||||
allFiles = undefined!;
|
||||
testProjectExpectedWatchedFiles = undefined!;
|
||||
testProjectExpectedWatchedDirectoriesRecursive = undefined!;
|
||||
});
|
||||
|
||||
function createSolutionInWatchMode(allFiles: ReadonlyArray<File>, defaultOptions?: BuildOptions, disableConsoleClears?: boolean) {
|
||||
const host = createTsBuildWatchSystem(allFiles, { currentDirectory: projectsLocation });
|
||||
@@ -172,9 +200,9 @@ namespace ts.tscWatch {
|
||||
content: `export const newFileConst = 30;`
|
||||
};
|
||||
|
||||
function verifyProjectChanges(allFiles: ReadonlyArray<File>) {
|
||||
function verifyProjectChanges(allFilesGetter: () => ReadonlyArray<File>) {
|
||||
function createSolutionInWatchModeToVerifyChanges(additionalFiles?: ReadonlyArray<[SubProject, string]>) {
|
||||
const host = createSolutionInWatchMode(allFiles);
|
||||
const host = createSolutionInWatchMode(allFilesGetter());
|
||||
return { host, verifyChangeWithFile, verifyChangeAfterTimeout, verifyWatches };
|
||||
|
||||
function verifyChangeWithFile(fileName: string, content: string, local?: boolean) {
|
||||
@@ -277,19 +305,21 @@ export class someClass2 { }`);
|
||||
}
|
||||
|
||||
describe("with simple project reference graph", () => {
|
||||
verifyProjectChanges(allFiles);
|
||||
verifyProjectChanges(() => allFiles);
|
||||
});
|
||||
|
||||
describe("with circular project reference", () => {
|
||||
const [coreTsconfig, ...otherCoreFiles] = core;
|
||||
const circularCoreConfig: File = {
|
||||
path: coreTsconfig.path,
|
||||
content: JSON.stringify({
|
||||
compilerOptions: { composite: true, declaration: true },
|
||||
references: [{ path: "../tests", circular: true }]
|
||||
})
|
||||
};
|
||||
verifyProjectChanges([libFile, circularCoreConfig, ...otherCoreFiles, ...logic, ...tests]);
|
||||
verifyProjectChanges(() => {
|
||||
const [coreTsconfig, ...otherCoreFiles] = core;
|
||||
const circularCoreConfig: File = {
|
||||
path: coreTsconfig.path,
|
||||
content: JSON.stringify({
|
||||
compilerOptions: { composite: true, declaration: true },
|
||||
references: [{ path: "../tests", circular: true }]
|
||||
})
|
||||
};
|
||||
return [libFile, circularCoreConfig, ...otherCoreFiles, ...logic, ...tests];
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -681,9 +711,9 @@ let x: string = 10;`);
|
||||
const coreIndexDts = projectFileName(SubProject.core, "index.d.ts");
|
||||
const coreAnotherModuleDts = projectFileName(SubProject.core, "anotherModule.d.ts");
|
||||
const logicIndexDts = projectFileName(SubProject.logic, "index.d.ts");
|
||||
const expectedWatchedFiles = [core[0], logic[0], ...tests, libFile].map(f => f.path).concat([coreIndexDts, coreAnotherModuleDts, logicIndexDts].map(f => f.toLowerCase()));
|
||||
const expectedWatchedFiles = () => [core[0], logic[0], ...tests, libFile].map(f => f.path).concat([coreIndexDts, coreAnotherModuleDts, logicIndexDts].map(f => f.toLowerCase()));
|
||||
const expectedWatchedDirectoriesRecursive = projectSystem.getTypeRootsFromLocation(projectPath(SubProject.tests));
|
||||
const expectedProgramFiles = [tests[1].path, libFile.path, coreIndexDts, coreAnotherModuleDts, logicIndexDts];
|
||||
const expectedProgramFiles = () => [tests[1].path, libFile.path, coreIndexDts, coreAnotherModuleDts, logicIndexDts];
|
||||
|
||||
function createSolutionAndWatchMode() {
|
||||
return createSolutionAndWatchModeOfProject(allFiles, projectsLocation, `${project}/${SubProject.tests}`, tests[0].path, getOutputFileStamps);
|
||||
@@ -694,12 +724,12 @@ let x: string = 10;`);
|
||||
}
|
||||
|
||||
function verifyWatches(host: TsBuildWatchSystem, withTsserver?: boolean) {
|
||||
verifyWatchesOfProject(host, withTsserver ? expectedWatchedFiles.filter(f => f !== tests[1].path.toLowerCase()) : expectedWatchedFiles, expectedWatchedDirectoriesRecursive);
|
||||
verifyWatchesOfProject(host, withTsserver ? expectedWatchedFiles().filter(f => f !== tests[1].path.toLowerCase()) : expectedWatchedFiles(), expectedWatchedDirectoriesRecursive);
|
||||
}
|
||||
|
||||
function verifyScenario(
|
||||
edit: (host: TsBuildWatchSystem, solutionBuilder: SolutionBuilder<EmitAndSemanticDiagnosticsBuilderProgram>) => void,
|
||||
expectedFilesAfterEdit: ReadonlyArray<string>
|
||||
expectedFilesAfterEdit: () => ReadonlyArray<string>
|
||||
) {
|
||||
it("with tsc-watch", () => {
|
||||
const { host, solutionBuilder, watch } = createSolutionAndWatchMode();
|
||||
@@ -708,7 +738,7 @@ let x: string = 10;`);
|
||||
|
||||
host.checkTimeoutQueueLengthAndRun(1);
|
||||
checkOutputErrorsIncremental(host, emptyArray);
|
||||
checkProgramActualFiles(watch(), expectedFilesAfterEdit);
|
||||
checkProgramActualFiles(watch(), expectedFilesAfterEdit());
|
||||
|
||||
});
|
||||
|
||||
@@ -718,7 +748,7 @@ let x: string = 10;`);
|
||||
edit(host, solutionBuilder);
|
||||
|
||||
host.checkTimeoutQueueLengthAndRun(2);
|
||||
checkProjectActualFiles(service, tests[0].path, [tests[0].path, ...expectedFilesAfterEdit]);
|
||||
checkProjectActualFiles(service, tests[0].path, [tests[0].path, ...expectedFilesAfterEdit()]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -729,7 +759,7 @@ let x: string = 10;`);
|
||||
verifyDependencies(watch, coreIndexDts, [coreIndexDts]);
|
||||
verifyDependencies(watch, coreAnotherModuleDts, [coreAnotherModuleDts]);
|
||||
verifyDependencies(watch, logicIndexDts, [logicIndexDts, coreAnotherModuleDts]);
|
||||
verifyDependencies(watch, tests[1].path, expectedProgramFiles.filter(f => f !== libFile.path));
|
||||
verifyDependencies(watch, tests[1].path, expectedProgramFiles().filter(f => f !== libFile.path));
|
||||
});
|
||||
|
||||
it("with tsserver", () => {
|
||||
@@ -769,7 +799,7 @@ export function gfoo() {
|
||||
}));
|
||||
solutionBuilder.invalidateProject(logic[0].path.toLowerCase() as ResolvedConfigFilePath, ConfigFileProgramReloadLevel.Full);
|
||||
solutionBuilder.buildNextInvalidatedProject();
|
||||
}, [tests[1].path, libFile.path, coreIndexDts, coreAnotherModuleDts, projectFilePath(SubProject.logic, "decls/index.d.ts")]);
|
||||
}, () => [tests[1].path, libFile.path, coreIndexDts, coreAnotherModuleDts, projectFilePath(SubProject.logic, "decls/index.d.ts")]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace ts.tscWatch {
|
||||
};
|
||||
const files = [file1, libFile];
|
||||
const environmentVariables = createMap<string>();
|
||||
environmentVariables.set("TSC_WATCHFILE", "DynamicPriorityPolling");
|
||||
environmentVariables.set("TSC_WATCHFILE", TestFSWithWatch.Tsc_WatchFile.DynamicPolling);
|
||||
const host = createWatchedSystem(files, { environmentVariables });
|
||||
const watch = createWatchOfFilesAndCompilerOptions([file1.path], host);
|
||||
|
||||
|
||||
@@ -503,6 +503,112 @@ namespace ts.projectSystem {
|
||||
});
|
||||
});
|
||||
|
||||
describe("for changes in declaration files", () => {
|
||||
function testDTS(dtsFileContents: string, tsFileContents: string, opts: CompilerOptions, expectDTSEmit: boolean) {
|
||||
const dtsFile = {
|
||||
path: "/a/runtime/a.d.ts",
|
||||
content: dtsFileContents
|
||||
};
|
||||
const f2 = {
|
||||
path: "/a/b.ts",
|
||||
content: tsFileContents
|
||||
};
|
||||
const config = {
|
||||
path: "/a/tsconfig.json",
|
||||
content: JSON.stringify({
|
||||
compilerOptions: opts,
|
||||
compileOnSave: true
|
||||
})
|
||||
};
|
||||
const host = createServerHost([dtsFile, f2, config]);
|
||||
const session = projectSystem.createSession(host);
|
||||
session.executeCommand(<protocol.OpenRequest>{
|
||||
seq: 1,
|
||||
type: "request",
|
||||
command: "open",
|
||||
arguments: { file: dtsFile.path }
|
||||
});
|
||||
const projectService = session.getProjectService();
|
||||
checkNumberOfProjects(projectService, { configuredProjects: 1 });
|
||||
const project = projectService.configuredProjects.get(config.path)!;
|
||||
checkProjectRootFiles(project, [dtsFile.path, f2.path]);
|
||||
session.executeCommand(<protocol.OpenRequest>{
|
||||
seq: 2,
|
||||
type: "request",
|
||||
command: "open",
|
||||
arguments: { file: f2.path }
|
||||
});
|
||||
checkNumberOfProjects(session.getProjectService(), { configuredProjects: 1 });
|
||||
const { response } = session.executeCommand(<protocol.CompileOnSaveAffectedFileListRequest>{
|
||||
seq: 3,
|
||||
type: "request",
|
||||
command: "compileOnSaveAffectedFileList",
|
||||
arguments: { file: dtsFile.path }
|
||||
});
|
||||
if (expectDTSEmit) {
|
||||
assert.equal((response as protocol.CompileOnSaveAffectedFileListSingleProject[]).length, 1, "expected output from 1 project");
|
||||
assert.equal((response as protocol.CompileOnSaveAffectedFileListSingleProject[])[0].fileNames.length, 2, "expected to affect 2 files");
|
||||
}
|
||||
else {
|
||||
assert.equal((response as protocol.CompileOnSaveAffectedFileListSingleProject[]).length, 0, "expected no output");
|
||||
}
|
||||
|
||||
|
||||
const { response: response2 } = session.executeCommand(<protocol.CompileOnSaveAffectedFileListRequest>{
|
||||
seq: 4,
|
||||
type: "request",
|
||||
command: "compileOnSaveAffectedFileList",
|
||||
arguments: { file: f2.path }
|
||||
});
|
||||
assert.equal((response2 as protocol.CompileOnSaveAffectedFileListSingleProject[]).length, 1, "expected output from 1 project");
|
||||
}
|
||||
|
||||
it("should return empty array if change is made in a global declaration file", () => {
|
||||
testDTS(
|
||||
/*dtsFileContents*/ "declare const x: string;",
|
||||
/*tsFileContents*/ "var y = 1;",
|
||||
/*opts*/ {},
|
||||
/*expectDTSEmit*/ false
|
||||
);
|
||||
});
|
||||
|
||||
it("should return empty array if change is made in a module declaration file", () => {
|
||||
testDTS(
|
||||
/*dtsFileContents*/ "export const x: string;",
|
||||
/*tsFileContents*/ "import { x } from './runtime/a;",
|
||||
/*opts*/ {},
|
||||
/*expectDTSEmit*/ false
|
||||
);
|
||||
});
|
||||
|
||||
it("should return results if change is made in a global declaration file with declaration emit", () => {
|
||||
testDTS(
|
||||
/*dtsFileContents*/ "declare const x: string;",
|
||||
/*tsFileContents*/ "var y = 1;",
|
||||
/*opts*/ { declaration: true },
|
||||
/*expectDTSEmit*/ true
|
||||
);
|
||||
});
|
||||
|
||||
it("should return results if change is made in a global declaration file with composite enabled", () => {
|
||||
testDTS(
|
||||
/*dtsFileContents*/ "declare const x: string;",
|
||||
/*tsFileContents*/ "var y = 1;",
|
||||
/*opts*/ { composite: true },
|
||||
/*expectDTSEmit*/ true
|
||||
);
|
||||
});
|
||||
|
||||
it("should return results if change is made in a global declaration file with decorator emit enabled", () => {
|
||||
testDTS(
|
||||
/*dtsFileContents*/ "declare const x: string;",
|
||||
/*tsFileContents*/ "var y = 1;",
|
||||
/*opts*/ { experimentalDecorators: true, emitDecoratorMetadata: true },
|
||||
/*expectDTSEmit*/ true
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("tsserverProjectSystem emit with outFile or out setting", () => {
|
||||
function test(opts: CompilerOptions, expectedUsesOutFile: boolean) {
|
||||
const f1 = {
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
namespace ts.projectSystem {
|
||||
interface DocumentSpanFromSubstring {
|
||||
file: File;
|
||||
text: string;
|
||||
options?: SpanFromSubstringOptions;
|
||||
contextText?: string;
|
||||
contextOptions?: SpanFromSubstringOptions;
|
||||
}
|
||||
function documentSpanFromSubstring({ file, text, contextText, options, contextOptions }: DocumentSpanFromSubstring): DocumentSpan {
|
||||
const contextSpan = contextText !== undefined ? documentSpanFromSubstring({ file, text: contextText, options: contextOptions }) : undefined;
|
||||
return {
|
||||
@@ -19,19 +12,6 @@ namespace ts.projectSystem {
|
||||
return documentSpanFromSubstring(input);
|
||||
}
|
||||
|
||||
interface MakeReferenceItem extends DocumentSpanFromSubstring {
|
||||
isDefinition: boolean;
|
||||
lineText: string;
|
||||
}
|
||||
function makeReferenceItem({ isDefinition, lineText, ...rest }: MakeReferenceItem): protocol.ReferencesResponseItem {
|
||||
return {
|
||||
...protocolFileSpanWithContextFromSubstring(rest),
|
||||
isDefinition,
|
||||
isWriteAccess: isDefinition,
|
||||
lineText,
|
||||
};
|
||||
}
|
||||
|
||||
interface MakeReferenceEntry extends DocumentSpanFromSubstring {
|
||||
isDefinition: boolean;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
namespace ts.projectSystem {
|
||||
describe("unittests:: tsserver:: getExportReferences", () => {
|
||||
const exportVariable = "export const value = 0;";
|
||||
const exportArrayDestructured = "export const [valueA, valueB] = [0, 1];";
|
||||
const exportObjectDestructured = "export const { valueC, valueD: renamedD } = { valueC: 0, valueD: 1 };";
|
||||
const exportNestedObject = "export const { nest: [valueE, { valueF }] } = { nest: [0, { valueF: 1 }] };";
|
||||
|
||||
const mainTs: File = {
|
||||
path: "/main.ts",
|
||||
content: 'import { value, valueA, valueB, valueC, renamedD, valueE, valueF } from "./mod";',
|
||||
};
|
||||
const modTs: File = {
|
||||
path: "/mod.ts",
|
||||
content: `${exportVariable}
|
||||
${exportArrayDestructured}
|
||||
${exportObjectDestructured}
|
||||
${exportNestedObject}
|
||||
`,
|
||||
};
|
||||
const tsconfig: File = {
|
||||
path: "/tsconfig.json",
|
||||
content: "{}",
|
||||
};
|
||||
|
||||
function makeSampleSession() {
|
||||
const host = createServerHost([mainTs, modTs, tsconfig]);
|
||||
const session = createSession(host);
|
||||
openFilesForSession([mainTs, modTs], session);
|
||||
return session;
|
||||
}
|
||||
|
||||
const referenceMainTs = (mainTs: File, text: string): protocol.ReferencesResponseItem =>
|
||||
makeReferenceItem({
|
||||
file: mainTs,
|
||||
isDefinition: true,
|
||||
lineText: mainTs.content,
|
||||
contextText: mainTs.content,
|
||||
text,
|
||||
});
|
||||
|
||||
const referenceModTs = (
|
||||
texts: { text: string; lineText: string; contextText?: string },
|
||||
override: Partial<MakeReferenceItem> = {},
|
||||
): protocol.ReferencesResponseItem =>
|
||||
makeReferenceItem({
|
||||
file: modTs,
|
||||
isDefinition: true,
|
||||
...texts,
|
||||
...override,
|
||||
});
|
||||
|
||||
it("should get const variable declaration references", () => {
|
||||
const session = makeSampleSession();
|
||||
|
||||
const response = executeSessionRequest<protocol.ReferencesRequest, protocol.ReferencesResponse>(
|
||||
session,
|
||||
protocol.CommandTypes.References,
|
||||
protocolFileLocationFromSubstring(modTs, "value"),
|
||||
);
|
||||
|
||||
const expectResponse = {
|
||||
refs: [
|
||||
referenceModTs({ text: "value", lineText: exportVariable, contextText: exportVariable }),
|
||||
referenceMainTs(mainTs, "value"),
|
||||
],
|
||||
symbolDisplayString: "const value: 0",
|
||||
symbolName: "value",
|
||||
symbolStartOffset: protocolLocationFromSubstring(modTs.content, "value").offset,
|
||||
};
|
||||
|
||||
assert.deepEqual(response, expectResponse);
|
||||
});
|
||||
|
||||
it("should get array destructuring declaration references", () => {
|
||||
const session = makeSampleSession();
|
||||
const response = executeSessionRequest<protocol.ReferencesRequest, protocol.ReferencesResponse>(
|
||||
session,
|
||||
protocol.CommandTypes.References,
|
||||
protocolFileLocationFromSubstring(modTs, "valueA"),
|
||||
);
|
||||
|
||||
const expectResponse = {
|
||||
refs: [
|
||||
referenceModTs({
|
||||
text: "valueA",
|
||||
lineText: exportArrayDestructured,
|
||||
contextText: exportArrayDestructured,
|
||||
}),
|
||||
referenceMainTs(mainTs, "valueA"),
|
||||
],
|
||||
symbolDisplayString: "const valueA: number",
|
||||
symbolName: "valueA",
|
||||
symbolStartOffset: protocolLocationFromSubstring(modTs.content, "valueA").offset,
|
||||
};
|
||||
|
||||
assert.deepEqual(response, expectResponse);
|
||||
});
|
||||
|
||||
it("should get object destructuring declaration references", () => {
|
||||
const session = makeSampleSession();
|
||||
const response = executeSessionRequest<protocol.ReferencesRequest, protocol.ReferencesResponse>(
|
||||
session,
|
||||
protocol.CommandTypes.References,
|
||||
protocolFileLocationFromSubstring(modTs, "valueC"),
|
||||
);
|
||||
const expectResponse = {
|
||||
refs: [
|
||||
referenceModTs({
|
||||
text: "valueC",
|
||||
lineText: exportObjectDestructured,
|
||||
contextText: exportObjectDestructured,
|
||||
}),
|
||||
referenceMainTs(mainTs, "valueC"),
|
||||
referenceModTs(
|
||||
{ text: "valueC", lineText: exportObjectDestructured, contextText: "valueC: 0" },
|
||||
{ options: { index: 1 } },
|
||||
),
|
||||
],
|
||||
symbolDisplayString: "const valueC: number",
|
||||
symbolName: "valueC",
|
||||
symbolStartOffset: protocolLocationFromSubstring(modTs.content, "valueC").offset,
|
||||
};
|
||||
|
||||
assert.deepEqual(response, expectResponse);
|
||||
});
|
||||
|
||||
it("should get object declaration references that renames destructured property", () => {
|
||||
const session = makeSampleSession();
|
||||
const response = executeSessionRequest<protocol.ReferencesRequest, protocol.ReferencesResponse>(
|
||||
session,
|
||||
protocol.CommandTypes.References,
|
||||
protocolFileLocationFromSubstring(modTs, "renamedD"),
|
||||
);
|
||||
|
||||
const expectResponse = {
|
||||
refs: [
|
||||
referenceModTs({
|
||||
text: "renamedD",
|
||||
lineText: exportObjectDestructured,
|
||||
contextText: exportObjectDestructured,
|
||||
}),
|
||||
referenceMainTs(mainTs, "renamedD"),
|
||||
],
|
||||
symbolDisplayString: "const renamedD: number",
|
||||
symbolName: "renamedD",
|
||||
symbolStartOffset: protocolLocationFromSubstring(modTs.content, "renamedD").offset,
|
||||
};
|
||||
|
||||
assert.deepEqual(response, expectResponse);
|
||||
});
|
||||
|
||||
it("should get nested object declaration references", () => {
|
||||
const session = makeSampleSession();
|
||||
const response = executeSessionRequest<protocol.ReferencesRequest, protocol.ReferencesResponse>(
|
||||
session,
|
||||
protocol.CommandTypes.References,
|
||||
protocolFileLocationFromSubstring(modTs, "valueF"),
|
||||
);
|
||||
|
||||
const expectResponse = {
|
||||
refs: [
|
||||
referenceModTs({
|
||||
text: "valueF",
|
||||
lineText: exportNestedObject,
|
||||
contextText: exportNestedObject,
|
||||
}),
|
||||
referenceMainTs(mainTs, "valueF"),
|
||||
referenceModTs(
|
||||
{
|
||||
text: "valueF",
|
||||
lineText: exportNestedObject,
|
||||
contextText: "valueF: 1",
|
||||
},
|
||||
{ options: { index: 1 } },
|
||||
),
|
||||
],
|
||||
symbolDisplayString: "const valueF: number",
|
||||
symbolName: "valueF",
|
||||
symbolStartOffset: protocolLocationFromSubstring(modTs.content, "valueF").offset,
|
||||
};
|
||||
|
||||
assert.deepEqual(response, expectResponse);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -519,6 +519,8 @@ namespace ts.projectSystem {
|
||||
file: File;
|
||||
text: string;
|
||||
options?: SpanFromSubstringOptions;
|
||||
contextText?: string;
|
||||
contextOptions?: SpanFromSubstringOptions;
|
||||
}
|
||||
export function protocolFileSpanFromSubstring({ file, text, options }: DocumentSpanFromSubstring): protocol.FileSpan {
|
||||
return { file: file.path, ...protocolTextSpanFromSubstring(file.content, text, options) };
|
||||
@@ -727,4 +729,18 @@ namespace ts.projectSystem {
|
||||
assert.strictEqual(outputs.length, index + 1, JSON.stringify(outputs));
|
||||
}
|
||||
}
|
||||
|
||||
export interface MakeReferenceItem extends DocumentSpanFromSubstring {
|
||||
isDefinition: boolean;
|
||||
lineText: string;
|
||||
}
|
||||
|
||||
export function makeReferenceItem({ isDefinition, lineText, ...rest }: MakeReferenceItem): protocol.ReferencesResponseItem {
|
||||
return {
|
||||
...protocolFileSpanWithContextFromSubstring(rest),
|
||||
isDefinition,
|
||||
isWriteAccess: isDefinition,
|
||||
lineText,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +180,18 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
msg(s: string, type: Msg = Msg.Err) {
|
||||
switch (type) {
|
||||
case Msg.Info:
|
||||
perfLogger.logInfoEvent(s);
|
||||
break;
|
||||
case Msg.Perf:
|
||||
perfLogger.logPerfEvent(s);
|
||||
break;
|
||||
default: // Msg.Err
|
||||
perfLogger.logErrEvent(s);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!this.canWrite) return;
|
||||
|
||||
s = `[${nowString()}] ${s}\n`;
|
||||
@@ -970,4 +982,12 @@ namespace ts.server {
|
||||
if (ts.sys.tryEnableSourceMapsForHost && /^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV"))) {
|
||||
ts.sys.tryEnableSourceMapsForHost();
|
||||
}
|
||||
|
||||
// Overwrites the current console messages to instead write to
|
||||
// the log. This is so that language service plugins which use
|
||||
// console.log don't break the message passing between tsserver
|
||||
// and the client
|
||||
console.log = (...args) => logger.msg(args.length === 1 ? args[0] : args.join(", "), Msg.Info);
|
||||
console.warn = (...args) => logger.msg(args.length === 1 ? args[0] : args.join(", "), Msg.Err);
|
||||
console.error = (...args) => logger.msg(args.length === 1 ? args[0] : args.join(", "), Msg.Err);
|
||||
}
|
||||
|
||||
@@ -4,15 +4,16 @@ for (var v of ['a', 'b', 'c']) {
|
||||
}
|
||||
|
||||
//// [ES5For-of33.js]
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var e_1, _a;
|
||||
try {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [ES5For-of33.js.map]
|
||||
{"version":3,"file":"ES5For-of33.js","sourceRoot":"","sources":["ES5For-of33.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,KAAc,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA,4BAAE;QAA1B,IAAI,CAAC,WAAA;QACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAClB"}
|
||||
{"version":3,"file":"ES5For-of33.js","sourceRoot":"","sources":["ES5For-of33.ts"],"names":[],"mappings":";;;;;;;;;;;;;IAAA,KAAc,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA,4BAAE;QAA1B,IAAI,CAAC,WAAA;QACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAClB"}
|
||||
@@ -8,15 +8,16 @@ sources: ES5For-of33.ts
|
||||
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of33.js
|
||||
sourceFile:ES5For-of33.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>var __values = (this && this.__values) || function (o) {
|
||||
>>> var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
>>>var __values = (this && this.__values) || function(o) {
|
||||
>>> var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
>>> if (m) return m.call(o);
|
||||
>>> return {
|
||||
>>> if (o && typeof o.length === "number") return {
|
||||
>>> next: function () {
|
||||
>>> if (o && i >= o.length) o = void 0;
|
||||
>>> return { value: o && o[i++], done: !o };
|
||||
>>> }
|
||||
>>> };
|
||||
>>> throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
>>>};
|
||||
>>>var e_1, _a;
|
||||
>>>try {
|
||||
@@ -51,21 +52,21 @@ sourceFile:ES5For-of33.ts
|
||||
13>
|
||||
14>
|
||||
15> )
|
||||
1 >Emitted(13, 5) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(13, 10) Source(1, 15) + SourceIndex(0)
|
||||
3 >Emitted(13, 14) Source(1, 15) + SourceIndex(0)
|
||||
4 >Emitted(13, 19) Source(1, 15) + SourceIndex(0)
|
||||
5 >Emitted(13, 28) Source(1, 15) + SourceIndex(0)
|
||||
6 >Emitted(13, 29) Source(1, 16) + SourceIndex(0)
|
||||
7 >Emitted(13, 32) Source(1, 19) + SourceIndex(0)
|
||||
8 >Emitted(13, 34) Source(1, 21) + SourceIndex(0)
|
||||
9 >Emitted(13, 37) Source(1, 24) + SourceIndex(0)
|
||||
10>Emitted(13, 39) Source(1, 26) + SourceIndex(0)
|
||||
11>Emitted(13, 42) Source(1, 29) + SourceIndex(0)
|
||||
12>Emitted(13, 43) Source(1, 30) + SourceIndex(0)
|
||||
13>Emitted(13, 44) Source(1, 30) + SourceIndex(0)
|
||||
14>Emitted(13, 60) Source(1, 30) + SourceIndex(0)
|
||||
15>Emitted(13, 88) Source(1, 32) + SourceIndex(0)
|
||||
1 >Emitted(14, 5) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(14, 10) Source(1, 15) + SourceIndex(0)
|
||||
3 >Emitted(14, 14) Source(1, 15) + SourceIndex(0)
|
||||
4 >Emitted(14, 19) Source(1, 15) + SourceIndex(0)
|
||||
5 >Emitted(14, 28) Source(1, 15) + SourceIndex(0)
|
||||
6 >Emitted(14, 29) Source(1, 16) + SourceIndex(0)
|
||||
7 >Emitted(14, 32) Source(1, 19) + SourceIndex(0)
|
||||
8 >Emitted(14, 34) Source(1, 21) + SourceIndex(0)
|
||||
9 >Emitted(14, 37) Source(1, 24) + SourceIndex(0)
|
||||
10>Emitted(14, 39) Source(1, 26) + SourceIndex(0)
|
||||
11>Emitted(14, 42) Source(1, 29) + SourceIndex(0)
|
||||
12>Emitted(14, 43) Source(1, 30) + SourceIndex(0)
|
||||
13>Emitted(14, 44) Source(1, 30) + SourceIndex(0)
|
||||
14>Emitted(14, 60) Source(1, 30) + SourceIndex(0)
|
||||
15>Emitted(14, 88) Source(1, 32) + SourceIndex(0)
|
||||
---
|
||||
>>> var v = _c.value;
|
||||
1 >^^^^^^^^
|
||||
@@ -76,10 +77,10 @@ sourceFile:ES5For-of33.ts
|
||||
2 > var
|
||||
3 > v
|
||||
4 >
|
||||
1 >Emitted(14, 9) Source(1, 6) + SourceIndex(0)
|
||||
2 >Emitted(14, 13) Source(1, 10) + SourceIndex(0)
|
||||
3 >Emitted(14, 14) Source(1, 11) + SourceIndex(0)
|
||||
4 >Emitted(14, 25) Source(1, 11) + SourceIndex(0)
|
||||
1 >Emitted(15, 9) Source(1, 6) + SourceIndex(0)
|
||||
2 >Emitted(15, 13) Source(1, 10) + SourceIndex(0)
|
||||
3 >Emitted(15, 14) Source(1, 11) + SourceIndex(0)
|
||||
4 >Emitted(15, 25) Source(1, 11) + SourceIndex(0)
|
||||
---
|
||||
>>> console.log(v);
|
||||
1 >^^^^^^^^
|
||||
@@ -99,20 +100,20 @@ sourceFile:ES5For-of33.ts
|
||||
6 > v
|
||||
7 > )
|
||||
8 > ;
|
||||
1 >Emitted(15, 9) Source(2, 5) + SourceIndex(0)
|
||||
2 >Emitted(15, 16) Source(2, 12) + SourceIndex(0)
|
||||
3 >Emitted(15, 17) Source(2, 13) + SourceIndex(0)
|
||||
4 >Emitted(15, 20) Source(2, 16) + SourceIndex(0)
|
||||
5 >Emitted(15, 21) Source(2, 17) + SourceIndex(0)
|
||||
6 >Emitted(15, 22) Source(2, 18) + SourceIndex(0)
|
||||
7 >Emitted(15, 23) Source(2, 19) + SourceIndex(0)
|
||||
8 >Emitted(15, 24) Source(2, 20) + SourceIndex(0)
|
||||
1 >Emitted(16, 9) Source(2, 5) + SourceIndex(0)
|
||||
2 >Emitted(16, 16) Source(2, 12) + SourceIndex(0)
|
||||
3 >Emitted(16, 17) Source(2, 13) + SourceIndex(0)
|
||||
4 >Emitted(16, 20) Source(2, 16) + SourceIndex(0)
|
||||
5 >Emitted(16, 21) Source(2, 17) + SourceIndex(0)
|
||||
6 >Emitted(16, 22) Source(2, 18) + SourceIndex(0)
|
||||
7 >Emitted(16, 23) Source(2, 19) + SourceIndex(0)
|
||||
8 >Emitted(16, 24) Source(2, 20) + SourceIndex(0)
|
||||
---
|
||||
>>> }
|
||||
1 >^^^^^
|
||||
1 >
|
||||
>}
|
||||
1 >Emitted(16, 6) Source(3, 2) + SourceIndex(0)
|
||||
1 >Emitted(17, 6) Source(3, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>}
|
||||
>>>catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
|
||||
@@ -7,15 +7,16 @@ for (foo().x of ['a', 'b', 'c']) {
|
||||
}
|
||||
|
||||
//// [ES5For-of34.js]
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var e_1, _a;
|
||||
function foo() {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [ES5For-of34.js.map]
|
||||
{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;;IACD,KAAgB,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA,4BAAE;QAA5B,GAAG,EAAE,CAAC,CAAC,WAAA;QACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;KACnB"}
|
||||
{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;;IACD,KAAgB,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA,4BAAE;QAA5B,GAAG,EAAE,CAAC,CAAC,WAAA;QACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;KACnB"}
|
||||
@@ -8,15 +8,16 @@ sources: ES5For-of34.ts
|
||||
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of34.js
|
||||
sourceFile:ES5For-of34.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>var __values = (this && this.__values) || function (o) {
|
||||
>>> var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
>>>var __values = (this && this.__values) || function(o) {
|
||||
>>> var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
>>> if (m) return m.call(o);
|
||||
>>> return {
|
||||
>>> if (o && typeof o.length === "number") return {
|
||||
>>> next: function () {
|
||||
>>> if (o && i >= o.length) o = void 0;
|
||||
>>> return { value: o && o[i++], done: !o };
|
||||
>>> }
|
||||
>>> };
|
||||
>>> throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
>>>};
|
||||
>>>var e_1, _a;
|
||||
>>>function foo() {
|
||||
@@ -27,9 +28,9 @@ sourceFile:ES5For-of34.ts
|
||||
1 >
|
||||
2 >function
|
||||
3 > foo
|
||||
1 >Emitted(12, 1) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(12, 10) Source(1, 10) + SourceIndex(0)
|
||||
3 >Emitted(12, 13) Source(1, 13) + SourceIndex(0)
|
||||
1 >Emitted(13, 1) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(13, 10) Source(1, 10) + SourceIndex(0)
|
||||
3 >Emitted(13, 13) Source(1, 13) + SourceIndex(0)
|
||||
---
|
||||
>>> return { x: 0 };
|
||||
1->^^^^
|
||||
@@ -49,14 +50,14 @@ sourceFile:ES5For-of34.ts
|
||||
6 > 0
|
||||
7 > }
|
||||
8 > ;
|
||||
1->Emitted(13, 5) Source(2, 5) + SourceIndex(0)
|
||||
2 >Emitted(13, 12) Source(2, 12) + SourceIndex(0)
|
||||
3 >Emitted(13, 14) Source(2, 14) + SourceIndex(0)
|
||||
4 >Emitted(13, 15) Source(2, 15) + SourceIndex(0)
|
||||
5 >Emitted(13, 17) Source(2, 17) + SourceIndex(0)
|
||||
6 >Emitted(13, 18) Source(2, 18) + SourceIndex(0)
|
||||
7 >Emitted(13, 20) Source(2, 20) + SourceIndex(0)
|
||||
8 >Emitted(13, 21) Source(2, 21) + SourceIndex(0)
|
||||
1->Emitted(14, 5) Source(2, 5) + SourceIndex(0)
|
||||
2 >Emitted(14, 12) Source(2, 12) + SourceIndex(0)
|
||||
3 >Emitted(14, 14) Source(2, 14) + SourceIndex(0)
|
||||
4 >Emitted(14, 15) Source(2, 15) + SourceIndex(0)
|
||||
5 >Emitted(14, 17) Source(2, 17) + SourceIndex(0)
|
||||
6 >Emitted(14, 18) Source(2, 18) + SourceIndex(0)
|
||||
7 >Emitted(14, 20) Source(2, 20) + SourceIndex(0)
|
||||
8 >Emitted(14, 21) Source(2, 21) + SourceIndex(0)
|
||||
---
|
||||
>>>}
|
||||
1 >
|
||||
@@ -65,8 +66,8 @@ sourceFile:ES5For-of34.ts
|
||||
1 >
|
||||
>
|
||||
2 >}
|
||||
1 >Emitted(14, 1) Source(3, 1) + SourceIndex(0)
|
||||
2 >Emitted(14, 2) Source(3, 2) + SourceIndex(0)
|
||||
1 >Emitted(15, 1) Source(3, 1) + SourceIndex(0)
|
||||
2 >Emitted(15, 2) Source(3, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>try {
|
||||
>>> for (var _b = __values(['a', 'b', 'c']), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
@@ -101,21 +102,21 @@ sourceFile:ES5For-of34.ts
|
||||
13>
|
||||
14>
|
||||
15> )
|
||||
1->Emitted(16, 5) Source(4, 1) + SourceIndex(0)
|
||||
2 >Emitted(16, 10) Source(4, 17) + SourceIndex(0)
|
||||
3 >Emitted(16, 14) Source(4, 17) + SourceIndex(0)
|
||||
4 >Emitted(16, 19) Source(4, 17) + SourceIndex(0)
|
||||
5 >Emitted(16, 28) Source(4, 17) + SourceIndex(0)
|
||||
6 >Emitted(16, 29) Source(4, 18) + SourceIndex(0)
|
||||
7 >Emitted(16, 32) Source(4, 21) + SourceIndex(0)
|
||||
8 >Emitted(16, 34) Source(4, 23) + SourceIndex(0)
|
||||
9 >Emitted(16, 37) Source(4, 26) + SourceIndex(0)
|
||||
10>Emitted(16, 39) Source(4, 28) + SourceIndex(0)
|
||||
11>Emitted(16, 42) Source(4, 31) + SourceIndex(0)
|
||||
12>Emitted(16, 43) Source(4, 32) + SourceIndex(0)
|
||||
13>Emitted(16, 44) Source(4, 32) + SourceIndex(0)
|
||||
14>Emitted(16, 60) Source(4, 32) + SourceIndex(0)
|
||||
15>Emitted(16, 88) Source(4, 34) + SourceIndex(0)
|
||||
1->Emitted(17, 5) Source(4, 1) + SourceIndex(0)
|
||||
2 >Emitted(17, 10) Source(4, 17) + SourceIndex(0)
|
||||
3 >Emitted(17, 14) Source(4, 17) + SourceIndex(0)
|
||||
4 >Emitted(17, 19) Source(4, 17) + SourceIndex(0)
|
||||
5 >Emitted(17, 28) Source(4, 17) + SourceIndex(0)
|
||||
6 >Emitted(17, 29) Source(4, 18) + SourceIndex(0)
|
||||
7 >Emitted(17, 32) Source(4, 21) + SourceIndex(0)
|
||||
8 >Emitted(17, 34) Source(4, 23) + SourceIndex(0)
|
||||
9 >Emitted(17, 37) Source(4, 26) + SourceIndex(0)
|
||||
10>Emitted(17, 39) Source(4, 28) + SourceIndex(0)
|
||||
11>Emitted(17, 42) Source(4, 31) + SourceIndex(0)
|
||||
12>Emitted(17, 43) Source(4, 32) + SourceIndex(0)
|
||||
13>Emitted(17, 44) Source(4, 32) + SourceIndex(0)
|
||||
14>Emitted(17, 60) Source(4, 32) + SourceIndex(0)
|
||||
15>Emitted(17, 88) Source(4, 34) + SourceIndex(0)
|
||||
---
|
||||
>>> foo().x = _c.value;
|
||||
1 >^^^^^^^^
|
||||
@@ -130,12 +131,12 @@ sourceFile:ES5For-of34.ts
|
||||
4 > .
|
||||
5 > x
|
||||
6 >
|
||||
1 >Emitted(17, 9) Source(4, 6) + SourceIndex(0)
|
||||
2 >Emitted(17, 12) Source(4, 9) + SourceIndex(0)
|
||||
3 >Emitted(17, 14) Source(4, 11) + SourceIndex(0)
|
||||
4 >Emitted(17, 15) Source(4, 12) + SourceIndex(0)
|
||||
5 >Emitted(17, 16) Source(4, 13) + SourceIndex(0)
|
||||
6 >Emitted(17, 27) Source(4, 13) + SourceIndex(0)
|
||||
1 >Emitted(18, 9) Source(4, 6) + SourceIndex(0)
|
||||
2 >Emitted(18, 12) Source(4, 9) + SourceIndex(0)
|
||||
3 >Emitted(18, 14) Source(4, 11) + SourceIndex(0)
|
||||
4 >Emitted(18, 15) Source(4, 12) + SourceIndex(0)
|
||||
5 >Emitted(18, 16) Source(4, 13) + SourceIndex(0)
|
||||
6 >Emitted(18, 27) Source(4, 13) + SourceIndex(0)
|
||||
---
|
||||
>>> var p = foo().x;
|
||||
1 >^^^^^^^^
|
||||
@@ -157,21 +158,21 @@ sourceFile:ES5For-of34.ts
|
||||
7 > .
|
||||
8 > x
|
||||
9 > ;
|
||||
1 >Emitted(18, 9) Source(5, 5) + SourceIndex(0)
|
||||
2 >Emitted(18, 13) Source(5, 9) + SourceIndex(0)
|
||||
3 >Emitted(18, 14) Source(5, 10) + SourceIndex(0)
|
||||
4 >Emitted(18, 17) Source(5, 13) + SourceIndex(0)
|
||||
5 >Emitted(18, 20) Source(5, 16) + SourceIndex(0)
|
||||
6 >Emitted(18, 22) Source(5, 18) + SourceIndex(0)
|
||||
7 >Emitted(18, 23) Source(5, 19) + SourceIndex(0)
|
||||
8 >Emitted(18, 24) Source(5, 20) + SourceIndex(0)
|
||||
9 >Emitted(18, 25) Source(5, 21) + SourceIndex(0)
|
||||
1 >Emitted(19, 9) Source(5, 5) + SourceIndex(0)
|
||||
2 >Emitted(19, 13) Source(5, 9) + SourceIndex(0)
|
||||
3 >Emitted(19, 14) Source(5, 10) + SourceIndex(0)
|
||||
4 >Emitted(19, 17) Source(5, 13) + SourceIndex(0)
|
||||
5 >Emitted(19, 20) Source(5, 16) + SourceIndex(0)
|
||||
6 >Emitted(19, 22) Source(5, 18) + SourceIndex(0)
|
||||
7 >Emitted(19, 23) Source(5, 19) + SourceIndex(0)
|
||||
8 >Emitted(19, 24) Source(5, 20) + SourceIndex(0)
|
||||
9 >Emitted(19, 25) Source(5, 21) + SourceIndex(0)
|
||||
---
|
||||
>>> }
|
||||
1 >^^^^^
|
||||
1 >
|
||||
>}
|
||||
1 >Emitted(19, 6) Source(6, 2) + SourceIndex(0)
|
||||
1 >Emitted(20, 6) Source(6, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>}
|
||||
>>>catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
|
||||
@@ -5,15 +5,16 @@ for (const {x: a = 0, y: b = 1} of [2, 3]) {
|
||||
}
|
||||
|
||||
//// [ES5For-of35.js]
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var e_1, _a;
|
||||
try {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [ES5For-of35.js.map]
|
||||
{"version":3,"file":"ES5For-of35.js","sourceRoot":"","sources":["ES5For-of35.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,KAAmC,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA,4BAAE;QAAhC,IAAA,aAAoB,EAAnB,SAAQ,EAAR,0BAAQ,EAAE,SAAQ,EAAR,0BAAQ;QAC1B,CAAC,CAAC;QACF,CAAC,CAAC;KACL"}
|
||||
{"version":3,"file":"ES5For-of35.js","sourceRoot":"","sources":["ES5For-of35.ts"],"names":[],"mappings":";;;;;;;;;;;;;IAAA,KAAmC,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA,4BAAE;QAAhC,IAAA,aAAoB,EAAnB,SAAQ,EAAR,0BAAQ,EAAE,SAAQ,EAAR,0BAAQ;QAC1B,CAAC,CAAC;QACF,CAAC,CAAC;KACL"}
|
||||
@@ -8,15 +8,16 @@ sources: ES5For-of35.ts
|
||||
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of35.js
|
||||
sourceFile:ES5For-of35.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>var __values = (this && this.__values) || function (o) {
|
||||
>>> var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
>>>var __values = (this && this.__values) || function(o) {
|
||||
>>> var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
>>> if (m) return m.call(o);
|
||||
>>> return {
|
||||
>>> if (o && typeof o.length === "number") return {
|
||||
>>> next: function () {
|
||||
>>> if (o && i >= o.length) o = void 0;
|
||||
>>> return { value: o && o[i++], done: !o };
|
||||
>>> }
|
||||
>>> };
|
||||
>>> throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
>>>};
|
||||
>>>var e_1, _a;
|
||||
>>>try {
|
||||
@@ -48,19 +49,19 @@ sourceFile:ES5For-of35.ts
|
||||
11>
|
||||
12>
|
||||
13> )
|
||||
1 >Emitted(13, 5) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(13, 10) Source(1, 36) + SourceIndex(0)
|
||||
3 >Emitted(13, 14) Source(1, 36) + SourceIndex(0)
|
||||
4 >Emitted(13, 19) Source(1, 36) + SourceIndex(0)
|
||||
5 >Emitted(13, 28) Source(1, 36) + SourceIndex(0)
|
||||
6 >Emitted(13, 29) Source(1, 37) + SourceIndex(0)
|
||||
7 >Emitted(13, 30) Source(1, 38) + SourceIndex(0)
|
||||
8 >Emitted(13, 32) Source(1, 40) + SourceIndex(0)
|
||||
9 >Emitted(13, 33) Source(1, 41) + SourceIndex(0)
|
||||
10>Emitted(13, 34) Source(1, 42) + SourceIndex(0)
|
||||
11>Emitted(13, 35) Source(1, 42) + SourceIndex(0)
|
||||
12>Emitted(13, 51) Source(1, 42) + SourceIndex(0)
|
||||
13>Emitted(13, 79) Source(1, 44) + SourceIndex(0)
|
||||
1 >Emitted(14, 5) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(14, 10) Source(1, 36) + SourceIndex(0)
|
||||
3 >Emitted(14, 14) Source(1, 36) + SourceIndex(0)
|
||||
4 >Emitted(14, 19) Source(1, 36) + SourceIndex(0)
|
||||
5 >Emitted(14, 28) Source(1, 36) + SourceIndex(0)
|
||||
6 >Emitted(14, 29) Source(1, 37) + SourceIndex(0)
|
||||
7 >Emitted(14, 30) Source(1, 38) + SourceIndex(0)
|
||||
8 >Emitted(14, 32) Source(1, 40) + SourceIndex(0)
|
||||
9 >Emitted(14, 33) Source(1, 41) + SourceIndex(0)
|
||||
10>Emitted(14, 34) Source(1, 42) + SourceIndex(0)
|
||||
11>Emitted(14, 35) Source(1, 42) + SourceIndex(0)
|
||||
12>Emitted(14, 51) Source(1, 42) + SourceIndex(0)
|
||||
13>Emitted(14, 79) Source(1, 44) + SourceIndex(0)
|
||||
---
|
||||
>>> var _d = _c.value, _e = _d.x, a = _e === void 0 ? 0 : _e, _f = _d.y, b = _f === void 0 ? 1 : _f;
|
||||
1->^^^^^^^^
|
||||
@@ -85,17 +86,17 @@ sourceFile:ES5For-of35.ts
|
||||
9 > y: b = 1
|
||||
10>
|
||||
11> y: b = 1
|
||||
1->Emitted(14, 9) Source(1, 12) + SourceIndex(0)
|
||||
2 >Emitted(14, 13) Source(1, 12) + SourceIndex(0)
|
||||
3 >Emitted(14, 26) Source(1, 32) + SourceIndex(0)
|
||||
4 >Emitted(14, 28) Source(1, 13) + SourceIndex(0)
|
||||
5 >Emitted(14, 37) Source(1, 21) + SourceIndex(0)
|
||||
6 >Emitted(14, 39) Source(1, 13) + SourceIndex(0)
|
||||
7 >Emitted(14, 65) Source(1, 21) + SourceIndex(0)
|
||||
8 >Emitted(14, 67) Source(1, 23) + SourceIndex(0)
|
||||
9 >Emitted(14, 76) Source(1, 31) + SourceIndex(0)
|
||||
10>Emitted(14, 78) Source(1, 23) + SourceIndex(0)
|
||||
11>Emitted(14, 104) Source(1, 31) + SourceIndex(0)
|
||||
1->Emitted(15, 9) Source(1, 12) + SourceIndex(0)
|
||||
2 >Emitted(15, 13) Source(1, 12) + SourceIndex(0)
|
||||
3 >Emitted(15, 26) Source(1, 32) + SourceIndex(0)
|
||||
4 >Emitted(15, 28) Source(1, 13) + SourceIndex(0)
|
||||
5 >Emitted(15, 37) Source(1, 21) + SourceIndex(0)
|
||||
6 >Emitted(15, 39) Source(1, 13) + SourceIndex(0)
|
||||
7 >Emitted(15, 65) Source(1, 21) + SourceIndex(0)
|
||||
8 >Emitted(15, 67) Source(1, 23) + SourceIndex(0)
|
||||
9 >Emitted(15, 76) Source(1, 31) + SourceIndex(0)
|
||||
10>Emitted(15, 78) Source(1, 23) + SourceIndex(0)
|
||||
11>Emitted(15, 104) Source(1, 31) + SourceIndex(0)
|
||||
---
|
||||
>>> a;
|
||||
1 >^^^^^^^^
|
||||
@@ -106,9 +107,9 @@ sourceFile:ES5For-of35.ts
|
||||
>
|
||||
2 > a
|
||||
3 > ;
|
||||
1 >Emitted(15, 9) Source(2, 5) + SourceIndex(0)
|
||||
2 >Emitted(15, 10) Source(2, 6) + SourceIndex(0)
|
||||
3 >Emitted(15, 11) Source(2, 7) + SourceIndex(0)
|
||||
1 >Emitted(16, 9) Source(2, 5) + SourceIndex(0)
|
||||
2 >Emitted(16, 10) Source(2, 6) + SourceIndex(0)
|
||||
3 >Emitted(16, 11) Source(2, 7) + SourceIndex(0)
|
||||
---
|
||||
>>> b;
|
||||
1->^^^^^^^^
|
||||
@@ -118,15 +119,15 @@ sourceFile:ES5For-of35.ts
|
||||
>
|
||||
2 > b
|
||||
3 > ;
|
||||
1->Emitted(16, 9) Source(3, 5) + SourceIndex(0)
|
||||
2 >Emitted(16, 10) Source(3, 6) + SourceIndex(0)
|
||||
3 >Emitted(16, 11) Source(3, 7) + SourceIndex(0)
|
||||
1->Emitted(17, 9) Source(3, 5) + SourceIndex(0)
|
||||
2 >Emitted(17, 10) Source(3, 6) + SourceIndex(0)
|
||||
3 >Emitted(17, 11) Source(3, 7) + SourceIndex(0)
|
||||
---
|
||||
>>> }
|
||||
1 >^^^^^
|
||||
1 >
|
||||
>}
|
||||
1 >Emitted(17, 6) Source(4, 2) + SourceIndex(0)
|
||||
1 >Emitted(18, 6) Source(4, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>}
|
||||
>>>catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
|
||||
@@ -5,15 +5,16 @@ for (let [a = 0, b = 1] of [2, 3]) {
|
||||
}
|
||||
|
||||
//// [ES5For-of36.js]
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [ES5For-of36.js.map]
|
||||
{"version":3,"file":"ES5For-of36.js","sourceRoot":"","sources":["ES5For-of36.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,KAA2B,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA,4BAAE;QAA1B,IAAA,wBAAc,EAAb,UAAK,EAAL,0BAAK,EAAE,UAAK,EAAL,0BAAK;QAClB,CAAC,CAAC;QACF,CAAC,CAAC;KACL"}
|
||||
{"version":3,"file":"ES5For-of36.js","sourceRoot":"","sources":["ES5For-of36.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,KAA2B,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA,4BAAE;QAA1B,IAAA,wBAAc,EAAb,UAAK,EAAL,0BAAK,EAAE,UAAK,EAAL,0BAAK;QAClB,CAAC,CAAC;QACF,CAAC,CAAC;KACL"}
|
||||
@@ -8,15 +8,16 @@ sources: ES5For-of36.ts
|
||||
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of36.js
|
||||
sourceFile:ES5For-of36.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>var __values = (this && this.__values) || function (o) {
|
||||
>>> var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
>>>var __values = (this && this.__values) || function(o) {
|
||||
>>> var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
>>> if (m) return m.call(o);
|
||||
>>> return {
|
||||
>>> if (o && typeof o.length === "number") return {
|
||||
>>> next: function () {
|
||||
>>> if (o && i >= o.length) o = void 0;
|
||||
>>> return { value: o && o[i++], done: !o };
|
||||
>>> }
|
||||
>>> };
|
||||
>>> throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
>>>};
|
||||
>>>var __read = (this && this.__read) || function (o, n) {
|
||||
>>> var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
@@ -64,19 +65,19 @@ sourceFile:ES5For-of36.ts
|
||||
11>
|
||||
12>
|
||||
13> )
|
||||
1 >Emitted(29, 5) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(29, 10) Source(1, 28) + SourceIndex(0)
|
||||
3 >Emitted(29, 14) Source(1, 28) + SourceIndex(0)
|
||||
4 >Emitted(29, 19) Source(1, 28) + SourceIndex(0)
|
||||
5 >Emitted(29, 28) Source(1, 28) + SourceIndex(0)
|
||||
6 >Emitted(29, 29) Source(1, 29) + SourceIndex(0)
|
||||
7 >Emitted(29, 30) Source(1, 30) + SourceIndex(0)
|
||||
8 >Emitted(29, 32) Source(1, 32) + SourceIndex(0)
|
||||
9 >Emitted(29, 33) Source(1, 33) + SourceIndex(0)
|
||||
10>Emitted(29, 34) Source(1, 34) + SourceIndex(0)
|
||||
11>Emitted(29, 35) Source(1, 34) + SourceIndex(0)
|
||||
12>Emitted(29, 51) Source(1, 34) + SourceIndex(0)
|
||||
13>Emitted(29, 79) Source(1, 36) + SourceIndex(0)
|
||||
1 >Emitted(30, 5) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(30, 10) Source(1, 28) + SourceIndex(0)
|
||||
3 >Emitted(30, 14) Source(1, 28) + SourceIndex(0)
|
||||
4 >Emitted(30, 19) Source(1, 28) + SourceIndex(0)
|
||||
5 >Emitted(30, 28) Source(1, 28) + SourceIndex(0)
|
||||
6 >Emitted(30, 29) Source(1, 29) + SourceIndex(0)
|
||||
7 >Emitted(30, 30) Source(1, 30) + SourceIndex(0)
|
||||
8 >Emitted(30, 32) Source(1, 32) + SourceIndex(0)
|
||||
9 >Emitted(30, 33) Source(1, 33) + SourceIndex(0)
|
||||
10>Emitted(30, 34) Source(1, 34) + SourceIndex(0)
|
||||
11>Emitted(30, 35) Source(1, 34) + SourceIndex(0)
|
||||
12>Emitted(30, 51) Source(1, 34) + SourceIndex(0)
|
||||
13>Emitted(30, 79) Source(1, 36) + SourceIndex(0)
|
||||
---
|
||||
>>> var _d = __read(_c.value, 2), _e = _d[0], a = _e === void 0 ? 0 : _e, _f = _d[1], b = _f === void 0 ? 1 : _f;
|
||||
1->^^^^^^^^
|
||||
@@ -101,17 +102,17 @@ sourceFile:ES5For-of36.ts
|
||||
9 > b = 1
|
||||
10>
|
||||
11> b = 1
|
||||
1->Emitted(30, 9) Source(1, 10) + SourceIndex(0)
|
||||
2 >Emitted(30, 13) Source(1, 10) + SourceIndex(0)
|
||||
3 >Emitted(30, 37) Source(1, 24) + SourceIndex(0)
|
||||
4 >Emitted(30, 39) Source(1, 11) + SourceIndex(0)
|
||||
5 >Emitted(30, 49) Source(1, 16) + SourceIndex(0)
|
||||
6 >Emitted(30, 51) Source(1, 11) + SourceIndex(0)
|
||||
7 >Emitted(30, 77) Source(1, 16) + SourceIndex(0)
|
||||
8 >Emitted(30, 79) Source(1, 18) + SourceIndex(0)
|
||||
9 >Emitted(30, 89) Source(1, 23) + SourceIndex(0)
|
||||
10>Emitted(30, 91) Source(1, 18) + SourceIndex(0)
|
||||
11>Emitted(30, 117) Source(1, 23) + SourceIndex(0)
|
||||
1->Emitted(31, 9) Source(1, 10) + SourceIndex(0)
|
||||
2 >Emitted(31, 13) Source(1, 10) + SourceIndex(0)
|
||||
3 >Emitted(31, 37) Source(1, 24) + SourceIndex(0)
|
||||
4 >Emitted(31, 39) Source(1, 11) + SourceIndex(0)
|
||||
5 >Emitted(31, 49) Source(1, 16) + SourceIndex(0)
|
||||
6 >Emitted(31, 51) Source(1, 11) + SourceIndex(0)
|
||||
7 >Emitted(31, 77) Source(1, 16) + SourceIndex(0)
|
||||
8 >Emitted(31, 79) Source(1, 18) + SourceIndex(0)
|
||||
9 >Emitted(31, 89) Source(1, 23) + SourceIndex(0)
|
||||
10>Emitted(31, 91) Source(1, 18) + SourceIndex(0)
|
||||
11>Emitted(31, 117) Source(1, 23) + SourceIndex(0)
|
||||
---
|
||||
>>> a;
|
||||
1 >^^^^^^^^
|
||||
@@ -122,9 +123,9 @@ sourceFile:ES5For-of36.ts
|
||||
>
|
||||
2 > a
|
||||
3 > ;
|
||||
1 >Emitted(31, 9) Source(2, 5) + SourceIndex(0)
|
||||
2 >Emitted(31, 10) Source(2, 6) + SourceIndex(0)
|
||||
3 >Emitted(31, 11) Source(2, 7) + SourceIndex(0)
|
||||
1 >Emitted(32, 9) Source(2, 5) + SourceIndex(0)
|
||||
2 >Emitted(32, 10) Source(2, 6) + SourceIndex(0)
|
||||
3 >Emitted(32, 11) Source(2, 7) + SourceIndex(0)
|
||||
---
|
||||
>>> b;
|
||||
1->^^^^^^^^
|
||||
@@ -134,15 +135,15 @@ sourceFile:ES5For-of36.ts
|
||||
>
|
||||
2 > b
|
||||
3 > ;
|
||||
1->Emitted(32, 9) Source(3, 5) + SourceIndex(0)
|
||||
2 >Emitted(32, 10) Source(3, 6) + SourceIndex(0)
|
||||
3 >Emitted(32, 11) Source(3, 7) + SourceIndex(0)
|
||||
1->Emitted(33, 9) Source(3, 5) + SourceIndex(0)
|
||||
2 >Emitted(33, 10) Source(3, 6) + SourceIndex(0)
|
||||
3 >Emitted(33, 11) Source(3, 7) + SourceIndex(0)
|
||||
---
|
||||
>>> }
|
||||
1 >^^^^^
|
||||
1 >
|
||||
>}
|
||||
1 >Emitted(33, 6) Source(4, 2) + SourceIndex(0)
|
||||
1 >Emitted(34, 6) Source(4, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>}
|
||||
>>>catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
|
||||
@@ -17,15 +17,16 @@ for (const i of [0, 1, 2, 3, 4]) {
|
||||
|
||||
//// [ES5For-of37.js]
|
||||
// https://github.com/microsoft/TypeScript/issues/30083
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var e_1, _a, e_2, _b;
|
||||
try {
|
||||
|
||||
+1
@@ -17,6 +17,7 @@
|
||||
"end": 13,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"originalKeywordKind": "TypeKeyword",
|
||||
"escapedText": "type"
|
||||
},
|
||||
"typeExpression": {
|
||||
|
||||
+1
@@ -17,6 +17,7 @@
|
||||
"end": 13,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"originalKeywordKind": "TypeKeyword",
|
||||
"escapedText": "type"
|
||||
},
|
||||
"typeExpression": {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"end": 15,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"originalKeywordKind": "ReturnKeyword",
|
||||
"escapedText": "return"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"end": 15,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"originalKeywordKind": "ReturnKeyword",
|
||||
"escapedText": "return"
|
||||
},
|
||||
"typeExpression": {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"end": 15,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"originalKeywordKind": "ReturnKeyword",
|
||||
"escapedText": "return"
|
||||
},
|
||||
"typeExpression": {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"end": 13,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"originalKeywordKind": "TypeKeyword",
|
||||
"escapedText": "type"
|
||||
},
|
||||
"typeExpression": {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
//// [tests/cases/compiler/amdModuleConstEnumUsage.ts] ////
|
||||
|
||||
//// [cc.ts]
|
||||
export const enum CharCode {
|
||||
A,
|
||||
B
|
||||
}
|
||||
//// [file.ts]
|
||||
import { CharCode } from 'defs/cc';
|
||||
export class User {
|
||||
method(input: number) {
|
||||
if (CharCode.A === input) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [cc.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var CharCode;
|
||||
(function (CharCode) {
|
||||
CharCode[CharCode["A"] = 0] = "A";
|
||||
CharCode[CharCode["B"] = 1] = "B";
|
||||
})(CharCode = exports.CharCode || (exports.CharCode = {}));
|
||||
});
|
||||
//// [file.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var User = /** @class */ (function () {
|
||||
function User() {
|
||||
}
|
||||
User.prototype.method = function (input) {
|
||||
if (0 /* A */ === input) { }
|
||||
};
|
||||
return User;
|
||||
}());
|
||||
exports.User = User;
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
=== /proj/defs/cc.ts ===
|
||||
export const enum CharCode {
|
||||
>CharCode : Symbol(CharCode, Decl(cc.ts, 0, 0))
|
||||
|
||||
A,
|
||||
>A : Symbol(CharCode.A, Decl(cc.ts, 0, 28))
|
||||
|
||||
B
|
||||
>B : Symbol(CharCode.B, Decl(cc.ts, 1, 6))
|
||||
}
|
||||
=== /proj/component/file.ts ===
|
||||
import { CharCode } from 'defs/cc';
|
||||
>CharCode : Symbol(CharCode, Decl(file.ts, 0, 8))
|
||||
|
||||
export class User {
|
||||
>User : Symbol(User, Decl(file.ts, 0, 35))
|
||||
|
||||
method(input: number) {
|
||||
>method : Symbol(User.method, Decl(file.ts, 1, 19))
|
||||
>input : Symbol(input, Decl(file.ts, 2, 11))
|
||||
|
||||
if (CharCode.A === input) {}
|
||||
>CharCode.A : Symbol(CharCode.A, Decl(cc.ts, 0, 28))
|
||||
>CharCode : Symbol(CharCode, Decl(file.ts, 0, 8))
|
||||
>A : Symbol(CharCode.A, Decl(cc.ts, 0, 28))
|
||||
>input : Symbol(input, Decl(file.ts, 2, 11))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
=== /proj/defs/cc.ts ===
|
||||
export const enum CharCode {
|
||||
>CharCode : CharCode
|
||||
|
||||
A,
|
||||
>A : CharCode.A
|
||||
|
||||
B
|
||||
>B : CharCode.B
|
||||
}
|
||||
=== /proj/component/file.ts ===
|
||||
import { CharCode } from 'defs/cc';
|
||||
>CharCode : typeof CharCode
|
||||
|
||||
export class User {
|
||||
>User : User
|
||||
|
||||
method(input: number) {
|
||||
>method : (input: number) => void
|
||||
>input : number
|
||||
|
||||
if (CharCode.A === input) {}
|
||||
>CharCode.A === input : boolean
|
||||
>CharCode.A : CharCode.A
|
||||
>CharCode : typeof CharCode
|
||||
>A : CharCode.A
|
||||
>input : number
|
||||
}
|
||||
}
|
||||
|
||||
+22
-22
@@ -2142,28 +2142,28 @@ declare namespace ts {
|
||||
ModuleExports = 134217728,
|
||||
Enum = 384,
|
||||
Variable = 3,
|
||||
Value = 67220415,
|
||||
Type = 67897832,
|
||||
Value = 111551,
|
||||
Type = 788968,
|
||||
Namespace = 1920,
|
||||
Module = 1536,
|
||||
Accessor = 98304,
|
||||
FunctionScopedVariableExcludes = 67220414,
|
||||
BlockScopedVariableExcludes = 67220415,
|
||||
ParameterExcludes = 67220415,
|
||||
FunctionScopedVariableExcludes = 111550,
|
||||
BlockScopedVariableExcludes = 111551,
|
||||
ParameterExcludes = 111551,
|
||||
PropertyExcludes = 0,
|
||||
EnumMemberExcludes = 68008959,
|
||||
FunctionExcludes = 67219887,
|
||||
ClassExcludes = 68008383,
|
||||
InterfaceExcludes = 67897736,
|
||||
RegularEnumExcludes = 68008191,
|
||||
ConstEnumExcludes = 68008831,
|
||||
EnumMemberExcludes = 900095,
|
||||
FunctionExcludes = 111023,
|
||||
ClassExcludes = 899519,
|
||||
InterfaceExcludes = 788872,
|
||||
RegularEnumExcludes = 899327,
|
||||
ConstEnumExcludes = 899967,
|
||||
ValueModuleExcludes = 110735,
|
||||
NamespaceModuleExcludes = 0,
|
||||
MethodExcludes = 67212223,
|
||||
GetAccessorExcludes = 67154879,
|
||||
SetAccessorExcludes = 67187647,
|
||||
TypeParameterExcludes = 67635688,
|
||||
TypeAliasExcludes = 67897832,
|
||||
MethodExcludes = 103359,
|
||||
GetAccessorExcludes = 46015,
|
||||
SetAccessorExcludes = 78783,
|
||||
TypeParameterExcludes = 526824,
|
||||
TypeAliasExcludes = 788968,
|
||||
AliasExcludes = 2097152,
|
||||
ModuleMember = 2623475,
|
||||
ExportHasLocal = 944,
|
||||
@@ -2784,11 +2784,11 @@ declare namespace ts {
|
||||
useCaseSensitiveFileNames(): boolean;
|
||||
getNewLine(): string;
|
||||
readDirectory?(rootDir: string, extensions: ReadonlyArray<string>, excludes: ReadonlyArray<string> | undefined, includes: ReadonlyArray<string>, depth?: number): string[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModule | undefined)[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
|
||||
/**
|
||||
* This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
|
||||
*/
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
getEnvironmentVariable?(name: string): string | undefined;
|
||||
createHash?(data: string): string;
|
||||
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
||||
@@ -4544,9 +4544,9 @@ declare namespace ts {
|
||||
/** If provided is used to get the environment variable */
|
||||
getEnvironmentVariable?(name: string): string | undefined;
|
||||
/** If provided, used to resolve the module names, otherwise typescript's default module resolution */
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModule | undefined)[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
|
||||
/** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
}
|
||||
interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
|
||||
/** If provided, callback to invoke after every new program creation */
|
||||
@@ -4901,9 +4901,9 @@ declare namespace ts {
|
||||
realpath?(path: string): string;
|
||||
fileExists?(path: string): boolean;
|
||||
getTypeRootsVersion?(): number;
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModule | undefined)[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
|
||||
getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined;
|
||||
resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
getDirectories?(directoryName: string): string[];
|
||||
/**
|
||||
* Gets a set of custom transformers to use during emit.
|
||||
|
||||
+22
-22
@@ -2142,28 +2142,28 @@ declare namespace ts {
|
||||
ModuleExports = 134217728,
|
||||
Enum = 384,
|
||||
Variable = 3,
|
||||
Value = 67220415,
|
||||
Type = 67897832,
|
||||
Value = 111551,
|
||||
Type = 788968,
|
||||
Namespace = 1920,
|
||||
Module = 1536,
|
||||
Accessor = 98304,
|
||||
FunctionScopedVariableExcludes = 67220414,
|
||||
BlockScopedVariableExcludes = 67220415,
|
||||
ParameterExcludes = 67220415,
|
||||
FunctionScopedVariableExcludes = 111550,
|
||||
BlockScopedVariableExcludes = 111551,
|
||||
ParameterExcludes = 111551,
|
||||
PropertyExcludes = 0,
|
||||
EnumMemberExcludes = 68008959,
|
||||
FunctionExcludes = 67219887,
|
||||
ClassExcludes = 68008383,
|
||||
InterfaceExcludes = 67897736,
|
||||
RegularEnumExcludes = 68008191,
|
||||
ConstEnumExcludes = 68008831,
|
||||
EnumMemberExcludes = 900095,
|
||||
FunctionExcludes = 111023,
|
||||
ClassExcludes = 899519,
|
||||
InterfaceExcludes = 788872,
|
||||
RegularEnumExcludes = 899327,
|
||||
ConstEnumExcludes = 899967,
|
||||
ValueModuleExcludes = 110735,
|
||||
NamespaceModuleExcludes = 0,
|
||||
MethodExcludes = 67212223,
|
||||
GetAccessorExcludes = 67154879,
|
||||
SetAccessorExcludes = 67187647,
|
||||
TypeParameterExcludes = 67635688,
|
||||
TypeAliasExcludes = 67897832,
|
||||
MethodExcludes = 103359,
|
||||
GetAccessorExcludes = 46015,
|
||||
SetAccessorExcludes = 78783,
|
||||
TypeParameterExcludes = 526824,
|
||||
TypeAliasExcludes = 788968,
|
||||
AliasExcludes = 2097152,
|
||||
ModuleMember = 2623475,
|
||||
ExportHasLocal = 944,
|
||||
@@ -2784,11 +2784,11 @@ declare namespace ts {
|
||||
useCaseSensitiveFileNames(): boolean;
|
||||
getNewLine(): string;
|
||||
readDirectory?(rootDir: string, extensions: ReadonlyArray<string>, excludes: ReadonlyArray<string> | undefined, includes: ReadonlyArray<string>, depth?: number): string[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModule | undefined)[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
|
||||
/**
|
||||
* This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
|
||||
*/
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
getEnvironmentVariable?(name: string): string | undefined;
|
||||
createHash?(data: string): string;
|
||||
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
||||
@@ -4544,9 +4544,9 @@ declare namespace ts {
|
||||
/** If provided is used to get the environment variable */
|
||||
getEnvironmentVariable?(name: string): string | undefined;
|
||||
/** If provided, used to resolve the module names, otherwise typescript's default module resolution */
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModule | undefined)[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
|
||||
/** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
}
|
||||
interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
|
||||
/** If provided, callback to invoke after every new program creation */
|
||||
@@ -4901,9 +4901,9 @@ declare namespace ts {
|
||||
realpath?(path: string): string;
|
||||
fileExists?(path: string): boolean;
|
||||
getTypeRootsVersion?(): number;
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference): (ResolvedModule | undefined)[];
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedModule | undefined)[];
|
||||
getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined;
|
||||
resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
getDirectories?(directoryName: string): string[];
|
||||
/**
|
||||
* Gets a set of custom transformers to use during emit.
|
||||
|
||||
@@ -34,15 +34,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
function a() {
|
||||
var _loop_1, _a, _b, i, e_1_1;
|
||||
|
||||
@@ -4,7 +4,7 @@ var lol = "hello Lol"
|
||||
>lol : Symbol(lol, Decl(0.js, 1, 3))
|
||||
|
||||
const obj = {
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1), Decl(0.js, 19, 7), Decl(0.js, 21, 23))
|
||||
|
||||
/** @type {string|undefined} */
|
||||
foo: undefined,
|
||||
@@ -40,31 +40,31 @@ const obj = {
|
||||
}
|
||||
obj.foo = 'string'
|
||||
>obj.foo : Symbol(foo, Decl(0.js, 2, 13))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1), Decl(0.js, 19, 7), Decl(0.js, 21, 23))
|
||||
>foo : Symbol(foo, Decl(0.js, 2, 13))
|
||||
|
||||
obj.lol
|
||||
>obj.lol : Symbol(lol, Decl(0.js, 10, 4))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1), Decl(0.js, 19, 7), Decl(0.js, 21, 23))
|
||||
>lol : Symbol(lol, Decl(0.js, 10, 4))
|
||||
|
||||
obj.bar = undefined;
|
||||
>obj.bar : Symbol(bar, Decl(0.js, 4, 17))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1), Decl(0.js, 19, 7), Decl(0.js, 21, 23))
|
||||
>bar : Symbol(bar, Decl(0.js, 4, 17))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
var k = obj.method1(0);
|
||||
>k : Symbol(k, Decl(0.js, 21, 3))
|
||||
>obj.method1 : Symbol(method1, Decl(0.js, 6, 12))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1), Decl(0.js, 19, 7), Decl(0.js, 21, 23))
|
||||
>method1 : Symbol(method1, Decl(0.js, 6, 12))
|
||||
|
||||
obj.bar1 = "42";
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1), Decl(0.js, 19, 7), Decl(0.js, 21, 23))
|
||||
|
||||
obj.arrowFunc(0);
|
||||
>obj.arrowFunc : Symbol(arrowFunc, Decl(0.js, 14, 20))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1))
|
||||
>obj : Symbol(obj, Decl(0.js, 2, 5), Decl(0.js, 17, 1), Decl(0.js, 19, 7), Decl(0.js, 21, 23))
|
||||
>arrowFunc : Symbol(arrowFunc, Decl(0.js, 14, 20))
|
||||
|
||||
|
||||
@@ -70,13 +70,13 @@ x.middleInit = "R"; // should also fail
|
||||
|
||||
=== tests/cases/conformance/jsdoc/index.js ===
|
||||
const x = {};
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
|
||||
Object.defineProperty(x, "name", { value: "Charles", writable: true });
|
||||
>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
>"name" : Symbol(x.name, Decl(index.js, 0, 13))
|
||||
>value : Symbol(value, Decl(index.js, 1, 34))
|
||||
>writable : Symbol(writable, Decl(index.js, 1, 52))
|
||||
@@ -85,7 +85,7 @@ Object.defineProperty(x, "middleInit", { value: "H" });
|
||||
>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
>"middleInit" : Symbol(x.middleInit, Decl(index.js, 1, 71))
|
||||
>value : Symbol(value, Decl(index.js, 2, 40))
|
||||
|
||||
@@ -93,7 +93,7 @@ Object.defineProperty(x, "lastName", { value: "Smith", writable: false });
|
||||
>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
>"lastName" : Symbol(x.lastName, Decl(index.js, 2, 55))
|
||||
>value : Symbol(value, Decl(index.js, 3, 38))
|
||||
>writable : Symbol(writable, Decl(index.js, 3, 54))
|
||||
@@ -102,7 +102,7 @@ Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ }
|
||||
>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
>"zip" : Symbol(x.zip, Decl(index.js, 3, 74))
|
||||
>get : Symbol(get, Decl(index.js, 4, 33))
|
||||
>set : Symbol(set, Decl(index.js, 4, 57))
|
||||
@@ -112,7 +112,7 @@ Object.defineProperty(x, "houseNumber", { get() { return 21.75 } });
|
||||
>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
>"houseNumber" : Symbol(x.houseNumber, Decl(index.js, 4, 83))
|
||||
>get : Symbol(get, Decl(index.js, 5, 41))
|
||||
|
||||
@@ -120,7 +120,7 @@ Object.defineProperty(x, "zipStr", {
|
||||
>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
>"zipStr" : Symbol(x.zipStr, Decl(index.js, 5, 68))
|
||||
|
||||
/** @param {string} str */
|
||||
@@ -147,7 +147,7 @@ function takeName(named) { return named.name; }
|
||||
|
||||
takeName(x);
|
||||
>takeName : Symbol(takeName, Decl(index.js, 11, 3))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
@@ -155,7 +155,7 @@ takeName(x);
|
||||
var a = x.zip;
|
||||
>a : Symbol(a, Decl(index.js, 22, 3))
|
||||
>x.zip : Symbol(x.zip, Decl(index.js, 3, 74))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
>zip : Symbol(x.zip, Decl(index.js, 3, 74))
|
||||
|
||||
/**
|
||||
@@ -164,17 +164,17 @@ var a = x.zip;
|
||||
var b = x.houseNumber;
|
||||
>b : Symbol(b, Decl(index.js, 27, 3))
|
||||
>x.houseNumber : Symbol(x.houseNumber, Decl(index.js, 4, 83))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
>houseNumber : Symbol(x.houseNumber, Decl(index.js, 4, 83))
|
||||
|
||||
const returnExemplar = () => x;
|
||||
>returnExemplar : Symbol(returnExemplar, Decl(index.js, 29, 5))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
|
||||
const needsExemplar = (_ = x) => void 0;
|
||||
>needsExemplar : Symbol(needsExemplar, Decl(index.js, 30, 5))
|
||||
>_ : Symbol(_, Decl(index.js, 30, 23))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
|
||||
const expected = /** @type {{name: string, readonly middleInit: string, readonly lastName: string, zip: number, readonly houseNumber: number, zipStr: string}} */(/** @type {*} */(null));
|
||||
>expected : Symbol(expected, Decl(index.js, 32, 5))
|
||||
@@ -199,5 +199,5 @@ module.exports = x;
|
||||
>module.exports : Symbol("tests/cases/conformance/jsdoc/index", Decl(index.js, 0, 0))
|
||||
>module : Symbol(export=, Decl(index.js, 41, 48))
|
||||
>exports : Symbol(export=, Decl(index.js, 41, 48))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22))
|
||||
>x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more)
|
||||
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
=== tests/cases/conformance/jsdoc/importer.js ===
|
||||
const mod = require("./mod1");
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
>require : Symbol(require)
|
||||
>"./mod1" : Symbol("tests/cases/conformance/jsdoc/mod1", Decl(mod1.js, 0, 0))
|
||||
|
||||
mod.thing;
|
||||
>mod.thing : Symbol(thing, Decl(mod1.js, 0, 42))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
>thing : Symbol(thing, Decl(mod1.js, 0, 42))
|
||||
|
||||
mod.other;
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
|
||||
mod.prop;
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
|
||||
mod.bad1;
|
||||
>mod.bad1 : Symbol(bad1, Decl(mod1.js, 10, 72))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
>bad1 : Symbol(bad1, Decl(mod1.js, 10, 72))
|
||||
|
||||
mod.bad2;
|
||||
>mod.bad2 : Symbol(bad2, Decl(mod1.js, 13, 44))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
>bad2 : Symbol(bad2, Decl(mod1.js, 13, 44))
|
||||
|
||||
mod.bad3;
|
||||
>mod.bad3 : Symbol(bad3, Decl(mod1.js, 14, 77))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
>bad3 : Symbol(bad3, Decl(mod1.js, 14, 77))
|
||||
|
||||
|
||||
mod.thing = 0;
|
||||
>mod.thing : Symbol(thing, Decl(mod1.js, 0, 42))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
>thing : Symbol(thing, Decl(mod1.js, 0, 42))
|
||||
|
||||
mod.other = 0;
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
|
||||
mod.prop = 0;
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
|
||||
mod.bad1 = 0;
|
||||
>mod.bad1 : Symbol(bad1, Decl(mod1.js, 10, 72))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
>bad1 : Symbol(bad1, Decl(mod1.js, 10, 72))
|
||||
|
||||
mod.bad2 = 0;
|
||||
>mod.bad2 : Symbol(bad2, Decl(mod1.js, 13, 44))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
>bad2 : Symbol(bad2, Decl(mod1.js, 13, 44))
|
||||
|
||||
mod.bad3 = 0;
|
||||
>mod.bad3 : Symbol(bad3, Decl(mod1.js, 14, 77))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9))
|
||||
>mod : Symbol(mod, Decl(importer.js, 0, 5), Decl(importer.js, 6, 9), Decl(importer.js, 9, 14), Decl(importer.js, 10, 14), Decl(importer.js, 11, 13) ... and 2 more)
|
||||
>bad3 : Symbol(bad3, Decl(mod1.js, 14, 77))
|
||||
|
||||
=== tests/cases/conformance/jsdoc/mod1.js ===
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
//// [tests/cases/compiler/constEnumNoPreserveDeclarationReexport.ts] ////
|
||||
|
||||
//// [ConstEnum.d.ts]
|
||||
export const enum MyConstEnum {
|
||||
Foo,
|
||||
Bar
|
||||
}
|
||||
//// [ImportExport.d.ts]
|
||||
import { MyConstEnum } from './ConstEnum';
|
||||
export default MyConstEnum;
|
||||
//// [ReExport.d.ts]
|
||||
export { MyConstEnum as default } from './ConstEnum';
|
||||
//// [usages.ts]
|
||||
import {MyConstEnum} from "./ConstEnum";
|
||||
import AlsoEnum from "./ImportExport";
|
||||
import StillEnum from "./ReExport";
|
||||
|
||||
MyConstEnum.Foo;
|
||||
AlsoEnum.Foo;
|
||||
StillEnum.Foo;
|
||||
|
||||
|
||||
//// [usages.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
0 /* Foo */;
|
||||
0 /* Foo */;
|
||||
0 /* Foo */;
|
||||
@@ -0,0 +1,47 @@
|
||||
=== tests/cases/compiler/ConstEnum.d.ts ===
|
||||
export const enum MyConstEnum {
|
||||
>MyConstEnum : Symbol(MyConstEnum, Decl(ConstEnum.d.ts, 0, 0))
|
||||
|
||||
Foo,
|
||||
>Foo : Symbol(MyConstEnum.Foo, Decl(ConstEnum.d.ts, 0, 31))
|
||||
|
||||
Bar
|
||||
>Bar : Symbol(MyConstEnum.Bar, Decl(ConstEnum.d.ts, 1, 8))
|
||||
}
|
||||
=== tests/cases/compiler/ImportExport.d.ts ===
|
||||
import { MyConstEnum } from './ConstEnum';
|
||||
>MyConstEnum : Symbol(MyConstEnum, Decl(ImportExport.d.ts, 0, 8))
|
||||
|
||||
export default MyConstEnum;
|
||||
>MyConstEnum : Symbol(MyConstEnum, Decl(ImportExport.d.ts, 0, 8))
|
||||
|
||||
=== tests/cases/compiler/ReExport.d.ts ===
|
||||
export { MyConstEnum as default } from './ConstEnum';
|
||||
>MyConstEnum : Symbol(MyConstEnum, Decl(ConstEnum.d.ts, 0, 0))
|
||||
>default : Symbol(default, Decl(ReExport.d.ts, 0, 8))
|
||||
|
||||
=== tests/cases/compiler/usages.ts ===
|
||||
import {MyConstEnum} from "./ConstEnum";
|
||||
>MyConstEnum : Symbol(MyConstEnum, Decl(usages.ts, 0, 8))
|
||||
|
||||
import AlsoEnum from "./ImportExport";
|
||||
>AlsoEnum : Symbol(AlsoEnum, Decl(usages.ts, 1, 6))
|
||||
|
||||
import StillEnum from "./ReExport";
|
||||
>StillEnum : Symbol(StillEnum, Decl(usages.ts, 2, 6))
|
||||
|
||||
MyConstEnum.Foo;
|
||||
>MyConstEnum.Foo : Symbol(MyConstEnum.Foo, Decl(ConstEnum.d.ts, 0, 31))
|
||||
>MyConstEnum : Symbol(MyConstEnum, Decl(usages.ts, 0, 8))
|
||||
>Foo : Symbol(MyConstEnum.Foo, Decl(ConstEnum.d.ts, 0, 31))
|
||||
|
||||
AlsoEnum.Foo;
|
||||
>AlsoEnum.Foo : Symbol(MyConstEnum.Foo, Decl(ConstEnum.d.ts, 0, 31))
|
||||
>AlsoEnum : Symbol(AlsoEnum, Decl(usages.ts, 1, 6))
|
||||
>Foo : Symbol(MyConstEnum.Foo, Decl(ConstEnum.d.ts, 0, 31))
|
||||
|
||||
StillEnum.Foo;
|
||||
>StillEnum.Foo : Symbol(MyConstEnum.Foo, Decl(ConstEnum.d.ts, 0, 31))
|
||||
>StillEnum : Symbol(StillEnum, Decl(usages.ts, 2, 6))
|
||||
>Foo : Symbol(MyConstEnum.Foo, Decl(ConstEnum.d.ts, 0, 31))
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
=== tests/cases/compiler/ConstEnum.d.ts ===
|
||||
export const enum MyConstEnum {
|
||||
>MyConstEnum : MyConstEnum
|
||||
|
||||
Foo,
|
||||
>Foo : MyConstEnum
|
||||
|
||||
Bar
|
||||
>Bar : MyConstEnum
|
||||
}
|
||||
=== tests/cases/compiler/ImportExport.d.ts ===
|
||||
import { MyConstEnum } from './ConstEnum';
|
||||
>MyConstEnum : typeof MyConstEnum
|
||||
|
||||
export default MyConstEnum;
|
||||
>MyConstEnum : MyConstEnum
|
||||
|
||||
=== tests/cases/compiler/ReExport.d.ts ===
|
||||
export { MyConstEnum as default } from './ConstEnum';
|
||||
>MyConstEnum : typeof import("tests/cases/compiler/ConstEnum").MyConstEnum
|
||||
>default : typeof import("tests/cases/compiler/ConstEnum").MyConstEnum
|
||||
|
||||
=== tests/cases/compiler/usages.ts ===
|
||||
import {MyConstEnum} from "./ConstEnum";
|
||||
>MyConstEnum : typeof MyConstEnum
|
||||
|
||||
import AlsoEnum from "./ImportExport";
|
||||
>AlsoEnum : typeof MyConstEnum
|
||||
|
||||
import StillEnum from "./ReExport";
|
||||
>StillEnum : typeof MyConstEnum
|
||||
|
||||
MyConstEnum.Foo;
|
||||
>MyConstEnum.Foo : MyConstEnum
|
||||
>MyConstEnum : typeof MyConstEnum
|
||||
>Foo : MyConstEnum
|
||||
|
||||
AlsoEnum.Foo;
|
||||
>AlsoEnum.Foo : MyConstEnum
|
||||
>AlsoEnum : typeof MyConstEnum
|
||||
>Foo : MyConstEnum
|
||||
|
||||
StillEnum.Foo;
|
||||
>StillEnum.Foo : MyConstEnum
|
||||
>StillEnum : typeof MyConstEnum
|
||||
>Foo : MyConstEnum
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
//// [tests/cases/compiler/constEnumPreserveEmitReexport.ts] ////
|
||||
|
||||
//// [ConstEnum.ts]
|
||||
export const enum MyConstEnum {
|
||||
Foo,
|
||||
Bar
|
||||
};
|
||||
//// [ImportExport.ts]
|
||||
import { MyConstEnum } from './ConstEnum';
|
||||
export default MyConstEnum;
|
||||
//// [ReExport.ts]
|
||||
export { MyConstEnum as default } from './ConstEnum';
|
||||
|
||||
//// [ConstEnum.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var MyConstEnum;
|
||||
(function (MyConstEnum) {
|
||||
MyConstEnum[MyConstEnum["Foo"] = 0] = "Foo";
|
||||
MyConstEnum[MyConstEnum["Bar"] = 1] = "Bar";
|
||||
})(MyConstEnum = exports.MyConstEnum || (exports.MyConstEnum = {}));
|
||||
;
|
||||
//// [ImportExport.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ConstEnum_1 = require("./ConstEnum");
|
||||
exports["default"] = ConstEnum_1.MyConstEnum;
|
||||
//// [ReExport.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ConstEnum_1 = require("./ConstEnum");
|
||||
exports["default"] = ConstEnum_1.MyConstEnum;
|
||||
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/ConstEnum.ts ===
|
||||
export const enum MyConstEnum {
|
||||
>MyConstEnum : Symbol(MyConstEnum, Decl(ConstEnum.ts, 0, 0))
|
||||
|
||||
Foo,
|
||||
>Foo : Symbol(MyConstEnum.Foo, Decl(ConstEnum.ts, 0, 31))
|
||||
|
||||
Bar
|
||||
>Bar : Symbol(MyConstEnum.Bar, Decl(ConstEnum.ts, 1, 8))
|
||||
|
||||
};
|
||||
=== tests/cases/compiler/ImportExport.ts ===
|
||||
import { MyConstEnum } from './ConstEnum';
|
||||
>MyConstEnum : Symbol(MyConstEnum, Decl(ImportExport.ts, 0, 8))
|
||||
|
||||
export default MyConstEnum;
|
||||
>MyConstEnum : Symbol(MyConstEnum, Decl(ImportExport.ts, 0, 8))
|
||||
|
||||
=== tests/cases/compiler/ReExport.ts ===
|
||||
export { MyConstEnum as default } from './ConstEnum';
|
||||
>MyConstEnum : Symbol(MyConstEnum, Decl(ConstEnum.ts, 0, 0))
|
||||
>default : Symbol(default, Decl(ReExport.ts, 0, 8))
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/ConstEnum.ts ===
|
||||
export const enum MyConstEnum {
|
||||
>MyConstEnum : MyConstEnum
|
||||
|
||||
Foo,
|
||||
>Foo : MyConstEnum.Foo
|
||||
|
||||
Bar
|
||||
>Bar : MyConstEnum.Bar
|
||||
|
||||
};
|
||||
=== tests/cases/compiler/ImportExport.ts ===
|
||||
import { MyConstEnum } from './ConstEnum';
|
||||
>MyConstEnum : typeof MyConstEnum
|
||||
|
||||
export default MyConstEnum;
|
||||
>MyConstEnum : MyConstEnum
|
||||
|
||||
=== tests/cases/compiler/ReExport.ts ===
|
||||
export { MyConstEnum as default } from './ConstEnum';
|
||||
>MyConstEnum : typeof import("tests/cases/compiler/ConstEnum").MyConstEnum
|
||||
>default : typeof import("tests/cases/compiler/ConstEnum").MyConstEnum
|
||||
|
||||
@@ -20,18 +20,18 @@ C.prototype.m = function() {
|
||||
>y : Symbol(C.y, Decl(a.js, 4, 28))
|
||||
}
|
||||
var c = new C(1)
|
||||
>c : Symbol(c, Decl(a.js, 7, 3), Decl(a.js, 7, 16))
|
||||
>c : Symbol(c, Decl(a.js, 7, 3), Decl(a.js, 7, 16), Decl(a.js, 8, 15))
|
||||
>C : Symbol(C, Decl(a.js, 0, 0))
|
||||
|
||||
c.x = undefined // should error
|
||||
>c.x : Symbol(C.x, Decl(a.js, 1, 15))
|
||||
>c : Symbol(c, Decl(a.js, 7, 3), Decl(a.js, 7, 16))
|
||||
>c : Symbol(c, Decl(a.js, 7, 3), Decl(a.js, 7, 16), Decl(a.js, 8, 15))
|
||||
>x : Symbol(C.x, Decl(a.js, 1, 15))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
c.y = undefined // ok
|
||||
>c.y : Symbol(C.y, Decl(a.js, 4, 28))
|
||||
>c : Symbol(c, Decl(a.js, 7, 3), Decl(a.js, 7, 16))
|
||||
>c : Symbol(c, Decl(a.js, 7, 3), Decl(a.js, 7, 16), Decl(a.js, 8, 15))
|
||||
>y : Symbol(C.y, Decl(a.js, 4, 28))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
// property assignment
|
||||
var ns = {}
|
||||
>ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11))
|
||||
>ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11), Decl(test.js, 11, 1))
|
||||
|
||||
/** @type {DoneStatus} */
|
||||
ns.x = {
|
||||
>ns.x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1))
|
||||
>ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11))
|
||||
>ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11), Decl(test.js, 11, 1))
|
||||
>x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1))
|
||||
|
||||
status: 'done',
|
||||
@@ -24,7 +24,7 @@ ns.x = {
|
||||
|
||||
ns.x = {
|
||||
>ns.x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1))
|
||||
>ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11))
|
||||
>ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11), Decl(test.js, 11, 1))
|
||||
>x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1))
|
||||
|
||||
status: 'done',
|
||||
@@ -36,7 +36,7 @@ ns.x = {
|
||||
}
|
||||
ns.x
|
||||
>ns.x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1))
|
||||
>ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11))
|
||||
>ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11), Decl(test.js, 11, 1))
|
||||
>x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1))
|
||||
|
||||
|
||||
|
||||
@@ -52,20 +52,20 @@ function B() { }
|
||||
>B : Symbol(B, Decl(index4.ts, 0, 17))
|
||||
|
||||
export function C() {
|
||||
>C : Symbol(C, Decl(index4.ts, 2, 16), Decl(index4.ts, 6, 1))
|
||||
>C : Symbol(C, Decl(index4.ts, 2, 16), Decl(index4.ts, 6, 1), Decl(index4.ts, 8, 8))
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
C.A = A;
|
||||
>C.A : Symbol(C.A, Decl(index4.ts, 6, 1))
|
||||
>C : Symbol(C, Decl(index4.ts, 2, 16), Decl(index4.ts, 6, 1))
|
||||
>C : Symbol(C, Decl(index4.ts, 2, 16), Decl(index4.ts, 6, 1), Decl(index4.ts, 8, 8))
|
||||
>A : Symbol(C.A, Decl(index4.ts, 6, 1))
|
||||
>A : Symbol(A, Decl(index4.ts, 0, 0))
|
||||
|
||||
C.B = B;
|
||||
>C.B : Symbol(C.B, Decl(index4.ts, 8, 8))
|
||||
>C : Symbol(C, Decl(index4.ts, 2, 16), Decl(index4.ts, 6, 1))
|
||||
>C : Symbol(C, Decl(index4.ts, 2, 16), Decl(index4.ts, 6, 1), Decl(index4.ts, 8, 8))
|
||||
>B : Symbol(C.B, Decl(index4.ts, 8, 8))
|
||||
>B : Symbol(B, Decl(index4.ts, 0, 17))
|
||||
|
||||
|
||||
@@ -2,20 +2,9 @@ Exit Code: 1
|
||||
Standard output:
|
||||
|
||||
Rush Multi-Project Build Tool 5.X.X - https://rushjs.io
|
||||
Node.js version is 12.7.0 (pre-LTS)
|
||||
Starting "rush rebuild"
|
||||
Executing a maximum of ?simultaneous processes...
|
||||
XX of XX: [@azure/abort-controller] completed successfully in ? seconds
|
||||
XX of XX: [@azure/core-asynciterator-polyfill] completed successfully in ? seconds
|
||||
XX of XX: [@azure/core-paging] completed successfully in ? seconds
|
||||
XX of XX: [@azure/cosmos] completed successfully in ? seconds
|
||||
XX of XX: [@azure/event-processor-host] completed successfully in ? seconds
|
||||
Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md
|
||||
XX of XX: [@azure/storage-blob] completed successfully in ? seconds
|
||||
XX of XX: [@azure/storage-file] completed successfully in ? seconds
|
||||
XX of XX: [@azure/storage-queue] completed successfully in ? seconds
|
||||
XX of XX: [@azure/template] completed successfully in ? seconds
|
||||
XX of XX: [testhub] completed successfully in ? seconds
|
||||
XX of XX: [@azure/core-auth] completed successfully in ? seconds
|
||||
npm ERR! code ELIFECYCLE
|
||||
npm ERR! errno 2
|
||||
npm ERR! @azure/core-http@X.X.X-preview.2 build:tsc: `tsc -p tsconfig.es.json`
|
||||
@@ -36,18 +25,30 @@ npm ERR! This is probably not a problem with npm. There is likely additional log
|
||||
npm ERR! A complete log of this run can be found in:
|
||||
npm ERR! /root/.npm/_logs/XXXX-XX-XXXXXXXXX-debug.log
|
||||
ERROR: "build:lib" exited with 1.
|
||||
XX of XX: [@azure/core-tracing] completed successfully in ? seconds
|
||||
XX of XX: [@azure/event-processor-host] completed successfully in ? seconds
|
||||
XX of XX: [@azure/abort-controller] completed successfully in ? seconds
|
||||
XX of XX: [@azure/core-asynciterator-polyfill] completed successfully in ? seconds
|
||||
XX of XX: [@azure/core-auth] completed successfully in ? seconds
|
||||
XX of XX: [@azure/core-paging] completed successfully in ? seconds
|
||||
XX of XX: [@azure/cosmos] completed successfully in ? seconds
|
||||
Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md
|
||||
XX of XX: [@azure/storage-blob] completed successfully in ? seconds
|
||||
XX of XX: [@azure/storage-file] completed successfully in ? seconds
|
||||
XX of XX: [@azure/storage-queue] completed successfully in ? seconds
|
||||
XX of XX: [testhub] completed successfully in ? seconds
|
||||
SUCCESS (11)
|
||||
================================
|
||||
@azure/abort-controller (? seconds)
|
||||
@azure/core-asynciterator-polyfill (? seconds)
|
||||
@azure/core-auth (? seconds)
|
||||
@azure/core-paging (? seconds)
|
||||
@azure/core-tracing (? seconds)
|
||||
@azure/cosmos (? seconds)
|
||||
@azure/event-processor-host (? seconds)
|
||||
@azure/storage-blob (? seconds)
|
||||
@azure/storage-file (? seconds)
|
||||
@azure/storage-queue (? seconds)
|
||||
@azure/template (? seconds)
|
||||
testhub (? seconds)
|
||||
================================
|
||||
SUCCESS WITH WARNINGS (1)
|
||||
@@ -55,7 +56,7 @@ SUCCESS WITH WARNINGS (1)
|
||||
@azure/service-bus (? seconds)
|
||||
Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md
|
||||
================================
|
||||
BLOCKED (7)
|
||||
BLOCKED (8)
|
||||
================================
|
||||
@azure/core-amqp
|
||||
@azure/core-arm
|
||||
@@ -64,10 +65,11 @@ BLOCKED (7)
|
||||
@azure/keyvault-certificates
|
||||
@azure/keyvault-keys
|
||||
@azure/keyvault-secrets
|
||||
@azure/template
|
||||
================================
|
||||
FAILURE (1)
|
||||
================================
|
||||
@azure/core-http (? seconds)
|
||||
@azure/core-http ( ? seconds)
|
||||
npm ERR! code ELIFECYCLE
|
||||
npm ERR! errno 2
|
||||
npm ERR! @azure/core-http@X.X.X-preview.2 build:tsc: `tsc -p tsconfig.es.json`
|
||||
@@ -95,8 +97,7 @@ rush rebuild - Errors! ( ? seconds)
|
||||
|
||||
|
||||
Standard error:
|
||||
Your version of Node.js (X.X.X) has not been tested with this release of Rush. The Rush team will not accept issue reports for it. Please consider upgrading Rush or downgrading Node.js.
|
||||
XX of XX: [@azure/service-bus] completed with warnings in ? seconds
|
||||
|
||||
XX of XX: [@azure/core-http] failed to build!
|
||||
XX of XX: [@azure/core-arm] blocked by [@azure/core-http]!
|
||||
XX of XX: [@azure/keyvault-certificates] blocked by [@azure/core-http]!
|
||||
@@ -105,4 +106,6 @@ XX of XX: [@azure/keyvault-secrets] blocked by [@azure/core-http]!
|
||||
XX of XX: [@azure/identity] blocked by [@azure/core-http]!
|
||||
XX of XX: [@azure/core-amqp] blocked by [@azure/core-http]!
|
||||
XX of XX: [@azure/event-hubs] blocked by [@azure/core-http]!
|
||||
XX of XX: [@azure/template] blocked by [@azure/core-http]!
|
||||
XX of XX: [@azure/service-bus] completed with warnings in ? seconds
|
||||
[@azure/core-http] Returned error code: 1
|
||||
|
||||
@@ -27,7 +27,7 @@ Standard output:
|
||||
@uifabric/set-version: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/set-version/tsconfig.json
|
||||
@uifabric/set-version: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/set-version/tsconfig.json"
|
||||
@uifabric/set-version: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/set-version/tsconfig.json
|
||||
@uifabric/set-version: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/set-version/tsconfig.json"
|
||||
@uifabric/set-version: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module esnext --project "/office-ui-fabric-react/packages/set-version/tsconfig.json"
|
||||
@uifabric/set-version: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/set-version/tsconfig.json
|
||||
@uifabric/set-version: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/set-version/tsconfig.json"
|
||||
@uifabric/set-version: [XX:XX:XX XM] ■ Running Webpack
|
||||
@@ -50,7 +50,7 @@ Standard output:
|
||||
@uifabric/merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/merge-styles/tsconfig.json
|
||||
@uifabric/merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json"
|
||||
@uifabric/merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/merge-styles/tsconfig.json
|
||||
@uifabric/merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json"
|
||||
@uifabric/merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module esnext --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json"
|
||||
@uifabric/merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/merge-styles/tsconfig.json
|
||||
@uifabric/merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json"
|
||||
@uifabric/merge-styles: [XX:XX:XX XM] ■ Running Jest
|
||||
@@ -78,7 +78,7 @@ Standard output:
|
||||
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json
|
||||
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json"
|
||||
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json
|
||||
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json"
|
||||
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module esnext --project "/office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json"
|
||||
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json
|
||||
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json"
|
||||
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running Jest
|
||||
@@ -91,7 +91,7 @@ Standard output:
|
||||
@uifabric/test-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/test-utilities/tsconfig.json
|
||||
@uifabric/test-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/test-utilities/tsconfig.json"
|
||||
@uifabric/test-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/test-utilities/tsconfig.json
|
||||
@uifabric/test-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/test-utilities/tsconfig.json"
|
||||
@uifabric/test-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module esnext --project "/office-ui-fabric-react/packages/test-utilities/tsconfig.json"
|
||||
@uifabric/test-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/test-utilities/tsconfig.json
|
||||
@uifabric/test-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/test-utilities/tsconfig.json"
|
||||
@uifabric/test-utilities: Done in ?s.
|
||||
@@ -103,7 +103,7 @@ Standard output:
|
||||
@uifabric/utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/utilities/tsconfig.json
|
||||
@uifabric/utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/utilities/tsconfig.json"
|
||||
@uifabric/utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/utilities/tsconfig.json
|
||||
@uifabric/utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/utilities/tsconfig.json"
|
||||
@uifabric/utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module esnext --project "/office-ui-fabric-react/packages/utilities/tsconfig.json"
|
||||
@uifabric/utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/utilities/tsconfig.json
|
||||
@uifabric/utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/utilities/tsconfig.json"
|
||||
@uifabric/utilities: [XX:XX:XX XM] ■ Running Jest
|
||||
@@ -156,7 +156,7 @@ Standard output:
|
||||
@uifabric/styling: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/styling/tsconfig.json
|
||||
@uifabric/styling: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/styling/tsconfig.json"
|
||||
@uifabric/styling: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/styling/tsconfig.json
|
||||
@uifabric/styling: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/styling/tsconfig.json"
|
||||
@uifabric/styling: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module esnext --project "/office-ui-fabric-react/packages/styling/tsconfig.json"
|
||||
@uifabric/styling: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/styling/tsconfig.json
|
||||
@uifabric/styling: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/styling/tsconfig.json"
|
||||
@uifabric/styling: [XX:XX:XX XM] ■ Running Jest
|
||||
@@ -179,7 +179,7 @@ Standard output:
|
||||
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/file-type-icons/tsconfig.json
|
||||
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/file-type-icons/tsconfig.json"
|
||||
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/file-type-icons/tsconfig.json
|
||||
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/file-type-icons/tsconfig.json"
|
||||
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module esnext --project "/office-ui-fabric-react/packages/file-type-icons/tsconfig.json"
|
||||
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/file-type-icons/tsconfig.json
|
||||
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/file-type-icons/tsconfig.json"
|
||||
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running Webpack
|
||||
@@ -194,7 +194,7 @@ Standard output:
|
||||
@uifabric/foundation: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/foundation/tsconfig.json
|
||||
@uifabric/foundation: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/foundation/tsconfig.json"
|
||||
@uifabric/foundation: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/foundation/tsconfig.json
|
||||
@uifabric/foundation: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/foundation/tsconfig.json"
|
||||
@uifabric/foundation: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module esnext --project "/office-ui-fabric-react/packages/foundation/tsconfig.json"
|
||||
@uifabric/foundation: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/foundation/tsconfig.json
|
||||
@uifabric/foundation: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/foundation/tsconfig.json"
|
||||
@uifabric/foundation: [XX:XX:XX XM] ■ Running Jest
|
||||
|
||||
@@ -282,15 +282,16 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var C4 = /** @class */ (function () {
|
||||
function C4() {
|
||||
@@ -363,15 +364,16 @@ var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var C5 = /** @class */ (function () {
|
||||
function C5() {
|
||||
|
||||
@@ -236,15 +236,16 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
function f4() {
|
||||
return __asyncGenerator(this, arguments, function f4_1() {
|
||||
@@ -312,15 +313,16 @@ var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
function f5() {
|
||||
return __asyncGenerator(this, arguments, function f5_1() {
|
||||
|
||||
@@ -236,15 +236,16 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var f4 = function () {
|
||||
return __asyncGenerator(this, arguments, function () {
|
||||
@@ -312,15 +313,16 @@ var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var f5 = function () {
|
||||
return __asyncGenerator(this, arguments, function () {
|
||||
|
||||
@@ -256,15 +256,16 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var o4 = {
|
||||
f: function () {
|
||||
@@ -334,15 +335,16 @@ var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
var o5 = {
|
||||
f: function () {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user