mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into property-use-before-declare
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "typescript",
|
||||
"author": "Microsoft Corp.",
|
||||
"homepage": "https://www.typescriptlang.org/",
|
||||
"version": "3.4.0",
|
||||
"version": "3.5.0",
|
||||
"license": "Apache-2.0",
|
||||
"description": "TypeScript is a language for application scale JavaScript development",
|
||||
"keywords": [
|
||||
|
||||
@@ -2710,8 +2710,7 @@ namespace ts {
|
||||
}
|
||||
else {
|
||||
const s = forEachIdentifierInEntityName(e.expression, parent, action);
|
||||
if (!s || !s.exports) return Debug.fail();
|
||||
return action(e.name, s.exports.get(e.name.escapedText), s);
|
||||
return action(e.name, s && s.exports && s.exports.get(e.name.escapedText), s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31500,7 +31500,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (node.exclamationToken && (node.parent.parent.kind !== SyntaxKind.VariableStatement || !node.type || node.initializer || node.flags & NodeFlags.Ambient)) {
|
||||
return grammarErrorOnNode(node.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
|
||||
return grammarErrorOnNode(node.exclamationToken, Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation);
|
||||
}
|
||||
|
||||
if (compilerOptions.module !== ModuleKind.ES2015 && compilerOptions.module !== ModuleKind.ESNext && compilerOptions.module !== ModuleKind.System && !compilerOptions.noEmit &&
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace ts {
|
||||
// WARNING: The script `configureNightly.ts` uses a regexp to parse out these values.
|
||||
// If changing the text in this section, be sure to test `configureNightly` too.
|
||||
export const versionMajorMinor = "3.4";
|
||||
export const versionMajorMinor = "3.5";
|
||||
/** The version of the TypeScript compiler release */
|
||||
export const version = `${versionMajorMinor}.0-dev`;
|
||||
}
|
||||
|
||||
@@ -847,6 +847,10 @@
|
||||
"category": "Error",
|
||||
"code": 1257
|
||||
},
|
||||
"Definite assignment assertions can only be used along with a type annotation.": {
|
||||
"category": "Error",
|
||||
"code": 1258
|
||||
},
|
||||
"'with' statements are not allowed in an async function block.": {
|
||||
"category": "Error",
|
||||
"code": 1300
|
||||
|
||||
+17
-6
@@ -2266,8 +2266,13 @@ namespace ts {
|
||||
|
||||
let redirectedPath: Path | undefined;
|
||||
if (refFile) {
|
||||
const redirect = getProjectReferenceRedirect(fileName);
|
||||
if (redirect) {
|
||||
const redirectProject = getProjectReferenceRedirectProject(fileName);
|
||||
if (redirectProject) {
|
||||
if (redirectProject.commandLine.options.outFile || redirectProject.commandLine.options.out) {
|
||||
// Shouldnt create many to 1 mapping file in --out scenario
|
||||
return undefined;
|
||||
}
|
||||
const redirect = getProjectReferenceOutputName(redirectProject, fileName);
|
||||
fileName = redirect;
|
||||
// Once we start redirecting to a file, we can potentially come back to it
|
||||
// via a back-reference from another file in the .d.ts folder. If that happens we'll
|
||||
@@ -2364,6 +2369,11 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getProjectReferenceRedirect(fileName: string): string | undefined {
|
||||
const referencedProject = getProjectReferenceRedirectProject(fileName);
|
||||
return referencedProject && getProjectReferenceOutputName(referencedProject, fileName);
|
||||
}
|
||||
|
||||
function getProjectReferenceRedirectProject(fileName: string) {
|
||||
// Ignore dts or any of the non ts files
|
||||
if (!resolvedProjectReferences || !resolvedProjectReferences.length || fileExtensionIs(fileName, Extension.Dts) || !fileExtensionIsOneOf(fileName, supportedTSExtensions)) {
|
||||
return undefined;
|
||||
@@ -2371,10 +2381,11 @@ namespace ts {
|
||||
|
||||
// If this file is produced by a referenced project, we need to rewrite it to
|
||||
// look in the output folder of the referenced project rather than the input
|
||||
const referencedProject = getResolvedProjectReferenceToRedirect(fileName);
|
||||
if (!referencedProject) {
|
||||
return undefined;
|
||||
}
|
||||
return getResolvedProjectReferenceToRedirect(fileName);
|
||||
}
|
||||
|
||||
|
||||
function getProjectReferenceOutputName(referencedProject: ResolvedProjectReference, fileName: string) {
|
||||
const out = referencedProject.commandLine.options.outFile || referencedProject.commandLine.options.out;
|
||||
return out ?
|
||||
changeExtension(out, Extension.Dts) :
|
||||
|
||||
@@ -327,6 +327,8 @@ namespace ts {
|
||||
createVariableDeclarationList(lexicalEnvironmentVariableDeclarations)
|
||||
);
|
||||
|
||||
setEmitFlags(statement, EmitFlags.CustomPrologue);
|
||||
|
||||
if (!statements) {
|
||||
statements = [statement];
|
||||
}
|
||||
|
||||
+25
-10
@@ -394,7 +394,7 @@ namespace ts {
|
||||
const projectStatus = createFileMap<UpToDateStatus>(toPath);
|
||||
const missingRoots = createMap<true>();
|
||||
let globalDependencyGraph: DependencyGraph | undefined;
|
||||
const writeFileName = (s: string) => host.trace && host.trace(s);
|
||||
const writeFileName = host.trace ? (s: string) => host.trace!(s) : undefined;
|
||||
let readFileWithCache = (f: string) => host.readFile(f);
|
||||
let projectCompilerOptions = baseCompilerOptions;
|
||||
const compilerHost = createCompilerHostFromProgramHost(host, () => projectCompilerOptions);
|
||||
@@ -1129,7 +1129,7 @@ namespace ts {
|
||||
let declDiagnostics: Diagnostic[] | undefined;
|
||||
const reportDeclarationDiagnostics = (d: Diagnostic) => (declDiagnostics || (declDiagnostics = [])).push(d);
|
||||
const outputFiles: OutputFile[] = [];
|
||||
emitFilesAndReportErrors(program, reportDeclarationDiagnostics, writeFileName, /*reportSummary*/ undefined, (name, text, writeByteOrderMark) => outputFiles.push({ name, text, writeByteOrderMark }));
|
||||
emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*writeFileName*/ undefined, /*reportSummary*/ undefined, (name, text, writeByteOrderMark) => outputFiles.push({ name, text, writeByteOrderMark }));
|
||||
// Don't emit .d.ts if there are decl file errors
|
||||
if (declDiagnostics) {
|
||||
program.restoreState();
|
||||
@@ -1138,7 +1138,7 @@ namespace ts {
|
||||
|
||||
// Actual Emit
|
||||
const emitterDiagnostics = createDiagnosticCollection();
|
||||
const emittedOutputs = createFileMap<true>(toPath as ToPath);
|
||||
const emittedOutputs = createFileMap<string>(toPath as ToPath);
|
||||
outputFiles.forEach(({ name, text, writeByteOrderMark }) => {
|
||||
let priorChangeTime: Date | undefined;
|
||||
if (!anyDtsChanged && isDeclarationFile(name)) {
|
||||
@@ -1152,7 +1152,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
emittedOutputs.setValue(name, true);
|
||||
emittedOutputs.setValue(name, name);
|
||||
writeFile(compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
||||
if (priorChangeTime !== undefined) {
|
||||
newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime);
|
||||
@@ -1165,6 +1165,11 @@ namespace ts {
|
||||
return buildErrors(emitDiagnostics, BuildResultFlags.EmitErrors, "Emit");
|
||||
}
|
||||
|
||||
if (writeFileName) {
|
||||
emittedOutputs.forEach(name => listEmittedFile(configFile, name));
|
||||
listFiles(program, writeFileName);
|
||||
}
|
||||
|
||||
// Update time stamps for rest of the outputs
|
||||
newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(configFile, newestDeclarationFileContentChangedTime, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
|
||||
|
||||
@@ -1182,6 +1187,8 @@ namespace ts {
|
||||
function buildErrors(diagnostics: ReadonlyArray<Diagnostic>, errorFlags: BuildResultFlags, errorType: string) {
|
||||
resultFlags |= errorFlags;
|
||||
reportAndStoreErrors(proj, diagnostics);
|
||||
// List files if any other build error using program (emit errors already report files)
|
||||
if (writeFileName) listFiles(program, writeFileName);
|
||||
projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: `${errorType} errors` });
|
||||
afterProgramCreate(proj, program);
|
||||
projectCompilerOptions = baseCompilerOptions;
|
||||
@@ -1189,6 +1196,12 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function listEmittedFile(proj: ParsedCommandLine, file: string) {
|
||||
if (writeFileName && proj.options.listEmittedFiles) {
|
||||
writeFileName(`TSFILE: ${file}`);
|
||||
}
|
||||
}
|
||||
|
||||
function afterProgramCreate(proj: ResolvedConfigFileName, program: T) {
|
||||
if (host.afterProgramEmitAndDiagnostics) {
|
||||
host.afterProgramEmitAndDiagnostics(program);
|
||||
@@ -1229,9 +1242,9 @@ namespace ts {
|
||||
// Actual Emit
|
||||
Debug.assert(!!outputFiles.length);
|
||||
const emitterDiagnostics = createDiagnosticCollection();
|
||||
const emittedOutputs = createFileMap<true>(toPath as ToPath);
|
||||
const emittedOutputs = createFileMap<string>(toPath as ToPath);
|
||||
outputFiles.forEach(({ name, text, writeByteOrderMark }) => {
|
||||
emittedOutputs.setValue(name, true);
|
||||
emittedOutputs.setValue(name, name);
|
||||
writeFile(compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
||||
});
|
||||
const emitDiagnostics = emitterDiagnostics.getDiagnostics();
|
||||
@@ -1242,6 +1255,10 @@ namespace ts {
|
||||
return BuildResultFlags.DeclarationOutputUnchanged | BuildResultFlags.EmitErrors;
|
||||
}
|
||||
|
||||
if (writeFileName) {
|
||||
emittedOutputs.forEach(name => listEmittedFile(config, name));
|
||||
}
|
||||
|
||||
// Update timestamps for dts
|
||||
const newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(config, minimumDate, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
|
||||
|
||||
@@ -1270,7 +1287,7 @@ namespace ts {
|
||||
projectStatus.setValue(proj.options.configFilePath as ResolvedConfigFilePath, status);
|
||||
}
|
||||
|
||||
function updateOutputTimestampsWorker(proj: ParsedCommandLine, priorNewestUpdateTime: Date, verboseMessage: DiagnosticMessage, skipOutputs?: FileMap<true>) {
|
||||
function updateOutputTimestampsWorker(proj: ParsedCommandLine, priorNewestUpdateTime: Date, verboseMessage: DiagnosticMessage, skipOutputs?: FileMap<string>) {
|
||||
const outputs = getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
|
||||
if (!skipOutputs || outputs.length !== skipOutputs.getSize()) {
|
||||
if (options.verbose) {
|
||||
@@ -1287,9 +1304,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
host.setModifiedTime(file, now);
|
||||
if (proj.options.listEmittedFiles) {
|
||||
writeFileName(`TSFILE: ${file}`);
|
||||
}
|
||||
listEmittedFile(proj, file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,6 +121,14 @@ namespace ts {
|
||||
emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult;
|
||||
}
|
||||
|
||||
export function listFiles(program: ProgramToEmitFilesAndReportErrors, writeFileName: (s: string) => void) {
|
||||
if (program.getCompilerOptions().listFiles) {
|
||||
forEach(program.getSourceFiles(), file => {
|
||||
writeFileName(file.fileName);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper that emit files, report diagnostics and lists emitted and/or source files depending on compiler options
|
||||
*/
|
||||
@@ -152,12 +160,7 @@ namespace ts {
|
||||
const filepath = getNormalizedAbsolutePath(file, currentDir);
|
||||
writeFileName(`TSFILE: ${filepath}`);
|
||||
});
|
||||
|
||||
if (program.getCompilerOptions().listFiles) {
|
||||
forEach(program.getSourceFiles(), file => {
|
||||
writeFileName(file.fileName);
|
||||
});
|
||||
}
|
||||
listFiles(program, writeFileName);
|
||||
}
|
||||
|
||||
if (reportSummary) {
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace ts.server {
|
||||
return <T>request;
|
||||
}
|
||||
|
||||
private processResponse<T extends protocol.Response>(request: protocol.Request): T {
|
||||
private processResponse<T extends protocol.Response>(request: protocol.Request, expectEmptyBody = false): T {
|
||||
let foundResponseMessage = false;
|
||||
let response!: T;
|
||||
while (!foundResponseMessage) {
|
||||
@@ -118,7 +118,8 @@ namespace ts.server {
|
||||
throw new Error("Error " + response.message);
|
||||
}
|
||||
|
||||
Debug.assert(!!response.body, "Malformed response: Unexpected empty response body.");
|
||||
Debug.assert(expectEmptyBody || !!response.body, "Malformed response: Unexpected empty response body.");
|
||||
Debug.assert(!expectEmptyBody || !response.body, "Malformed response: Unexpected non-empty response body.");
|
||||
|
||||
return response;
|
||||
}
|
||||
@@ -696,7 +697,8 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
configurePlugin(pluginName: string, configuration: any): void {
|
||||
this.processRequest<protocol.ConfigurePluginRequest>("configurePlugin", { pluginName, configuration });
|
||||
const request = this.processRequest<protocol.ConfigurePluginRequest>("configurePlugin", { pluginName, configuration });
|
||||
this.processResponse<protocol.ConfigurePluginResponse>(request, /*expectEmptyBody*/ true);
|
||||
}
|
||||
|
||||
getIndentationAtPosition(_fileName: string, _position: number, _options: EditorOptions): number {
|
||||
|
||||
@@ -4507,6 +4507,7 @@ namespace FourSlashInterface {
|
||||
typeEntry("Record"),
|
||||
typeEntry("Exclude"),
|
||||
typeEntry("Extract"),
|
||||
typeEntry("Omit"),
|
||||
typeEntry("NonNullable"),
|
||||
typeEntry("Parameters"),
|
||||
typeEntry("ConstructorParameters"),
|
||||
|
||||
Vendored
+5
@@ -1443,6 +1443,11 @@ type Exclude<T, U> = T extends U ? never : T;
|
||||
*/
|
||||
type Extract<T, U> = T extends U ? T : never;
|
||||
|
||||
/**
|
||||
* Construct a type with the properties of T except for those in type K.
|
||||
*/
|
||||
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
/**
|
||||
* Exclude null and undefined from T
|
||||
*/
|
||||
|
||||
@@ -1607,7 +1607,8 @@ namespace ts.server {
|
||||
this.documentRegistry,
|
||||
compilerOptions,
|
||||
/*lastFileExceededProgramSize*/ this.getFilenameForExceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader),
|
||||
options.compileOnSave === undefined ? true : options.compileOnSave);
|
||||
options.compileOnSave === undefined ? true : options.compileOnSave,
|
||||
/*projectFilePath*/ undefined, this.currentPluginConfigOverrides);
|
||||
project.excludedFiles = excludedFiles;
|
||||
|
||||
this.addFilesToNonInferredProject(project, files, externalFilePropertyReader, typeAcquisition);
|
||||
|
||||
@@ -1610,7 +1610,8 @@ namespace ts.server {
|
||||
compilerOptions: CompilerOptions,
|
||||
lastFileExceededProgramSize: string | undefined,
|
||||
public compileOnSaveEnabled: boolean,
|
||||
projectFilePath?: string) {
|
||||
projectFilePath?: string,
|
||||
pluginConfigOverrides?: Map<any>) {
|
||||
super(externalProjectName,
|
||||
ProjectKind.External,
|
||||
projectService,
|
||||
@@ -1621,6 +1622,7 @@ namespace ts.server {
|
||||
compileOnSaveEnabled,
|
||||
projectService.host,
|
||||
getDirectoryPath(projectFilePath || normalizeSlashes(externalProjectName)));
|
||||
this.enableGlobalPlugins(this.getCompilerOptions(), pluginConfigOverrides);
|
||||
}
|
||||
|
||||
updateGraph() {
|
||||
|
||||
@@ -1392,6 +1392,9 @@ namespace ts.server.protocol {
|
||||
arguments: ConfigurePluginRequestArguments;
|
||||
}
|
||||
|
||||
export interface ConfigurePluginResponse extends Response {
|
||||
}
|
||||
|
||||
/**
|
||||
* Information found in an "open" request.
|
||||
*/
|
||||
|
||||
@@ -2412,6 +2412,7 @@ namespace ts.server {
|
||||
},
|
||||
[CommandNames.ConfigurePlugin]: (request: protocol.ConfigurePluginRequest) => {
|
||||
this.configurePlugin(request.arguments);
|
||||
this.doOutput(/*info*/ undefined, CommandNames.ConfigurePlugin, request.seq, /*success*/ true);
|
||||
return this.notRequired();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -198,6 +198,58 @@ ${internal} export enum internalEnum { a, b, c }`);
|
||||
modifyAgainFs: fs => replaceText(fs, sources[project.lib][source.ts][1], `export const`, `/*@internal*/ export const`),
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the module resolution finds original source file", () => {
|
||||
function modifyFs(fs: vfs.FileSystem) {
|
||||
// Make lib to output to parent dir
|
||||
replaceText(fs, sources[project.lib][source.config], `"outFile": "module.js"`, `"outFile": "../module.js", "rootDir": "../"`);
|
||||
// Change reference to file1 module to resolve to lib/file1
|
||||
replaceText(fs, sources[project.app][source.ts][0], "file1", "lib/file1");
|
||||
}
|
||||
|
||||
const libOutputFile: OutputFile = [
|
||||
"/src/lib/module.js",
|
||||
"/src/lib/module.js.map",
|
||||
"/src/lib/module.d.ts",
|
||||
"/src/lib/module.d.ts.map",
|
||||
"/src/lib/module.tsbuildinfo"
|
||||
];
|
||||
verifyTsbuildOutput({
|
||||
scenario: "when the module resolution finds original source file",
|
||||
projFs: () => outFileFs,
|
||||
time,
|
||||
tick,
|
||||
proj: "amdModulesWithOut",
|
||||
rootNames: ["/src/app"],
|
||||
expectedMapFileNames: [
|
||||
libOutputFile[ext.jsmap],
|
||||
libOutputFile[ext.dtsmap],
|
||||
outputFiles[project.app][ext.jsmap],
|
||||
outputFiles[project.app][ext.dtsmap],
|
||||
],
|
||||
expectedBuildInfoFilesForSectionBaselines: [
|
||||
[libOutputFile[ext.buildinfo], libOutputFile[ext.js], libOutputFile[ext.dts]],
|
||||
[outputFiles[project.app][ext.buildinfo], outputFiles[project.app][ext.js], outputFiles[project.app][ext.dts]]
|
||||
],
|
||||
lastProjectOutputJs: outputFiles[project.app][ext.js],
|
||||
initialBuild: {
|
||||
modifyFs,
|
||||
expectedDiagnostics: [
|
||||
getExpectedDiagnosticForProjectsInBuild("src/lib/tsconfig.json", "src/app/tsconfig.json"),
|
||||
[Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/lib/tsconfig.json", "src/module.js"],
|
||||
[Diagnostics.Building_project_0, sources[project.lib][source.config]],
|
||||
[Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/app/tsconfig.json", "src/app/module.js"],
|
||||
[Diagnostics.Building_project_0, sources[project.app][source.config]],
|
||||
]
|
||||
},
|
||||
outputFiles: [
|
||||
...libOutputFile,
|
||||
...outputFiles[project.app]
|
||||
],
|
||||
baselineOnly: true,
|
||||
verifyDiagnostics: true
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -234,10 +234,11 @@ Mismatch Actual(path, actual, expected): ${JSON.stringify(arrayFrom(mapDefinedIt
|
||||
incrementalDtsUnchangedBuild?: BuildState;
|
||||
incrementalHeaderChangedBuild?: BuildState;
|
||||
baselineOnly?: true;
|
||||
verifyDiagnostics?: true;
|
||||
}
|
||||
|
||||
export function verifyTsbuildOutput({
|
||||
scenario, projFs, time, tick, proj, rootNames, outputFiles, baselineOnly,
|
||||
scenario, projFs, time, tick, proj, rootNames, outputFiles, baselineOnly, verifyDiagnostics,
|
||||
expectedMapFileNames, expectedBuildInfoFilesForSectionBaselines, lastProjectOutputJs,
|
||||
initialBuild, incrementalDtsChangedBuild, incrementalDtsUnchangedBuild, incrementalHeaderChangedBuild
|
||||
}: VerifyTsBuildInput) {
|
||||
@@ -264,7 +265,7 @@ Mismatch Actual(path, actual, expected): ${JSON.stringify(arrayFrom(mapDefinedIt
|
||||
host = undefined!;
|
||||
});
|
||||
describe("initialBuild", () => {
|
||||
if (!baselineOnly) {
|
||||
if (!baselineOnly || verifyDiagnostics) {
|
||||
it(`verify diagnostics`, () => {
|
||||
host.assertDiagnosticMessages(...(initialBuild.expectedDiagnostics || emptyArray));
|
||||
});
|
||||
|
||||
@@ -427,14 +427,14 @@ export class cNew {}`);
|
||||
builder.buildAllProjects();
|
||||
assert.deepEqual(host.traces, [
|
||||
"TSFILE: /src/core/anotherModule.js",
|
||||
"TSFILE: /src/core/anotherModule.d.ts",
|
||||
"TSFILE: /src/core/anotherModule.d.ts.map",
|
||||
"TSFILE: /src/core/anotherModule.d.ts",
|
||||
"TSFILE: /src/core/index.js",
|
||||
"TSFILE: /src/core/index.d.ts",
|
||||
"TSFILE: /src/core/index.d.ts.map",
|
||||
"TSFILE: /src/core/index.d.ts",
|
||||
"TSFILE: /src/core/tsconfig.tsbuildinfo",
|
||||
"TSFILE: /src/logic/index.js",
|
||||
"TSFILE: /src/logic/index.js.map",
|
||||
"TSFILE: /src/logic/index.js",
|
||||
"TSFILE: /src/logic/index.d.ts",
|
||||
"TSFILE: /src/logic/tsconfig.tsbuildinfo",
|
||||
"TSFILE: /src/tests/index.js",
|
||||
|
||||
@@ -65,6 +65,8 @@ export const b = new A();`);
|
||||
const expectedFileTraces = [
|
||||
...getLibs(),
|
||||
"/src/a.ts",
|
||||
...getLibs(),
|
||||
"/src/b.ts"
|
||||
];
|
||||
verifyBuild(fs => modifyFsBTsToNonRelativeImport(fs, "node"),
|
||||
allExpectedOutputs,
|
||||
|
||||
@@ -50,6 +50,68 @@ namespace ts.projectSystem {
|
||||
});
|
||||
});
|
||||
|
||||
it("load global plugins", () => {
|
||||
const f1 = {
|
||||
path: "/a/file1.ts",
|
||||
content: "let x = [1, 2];"
|
||||
};
|
||||
const p1 = { projectFileName: "/a/proj1.csproj", rootFiles: [toExternalFile(f1.path)], options: {} };
|
||||
|
||||
const host = createServerHost([f1]);
|
||||
host.require = (_initialPath, moduleName) => {
|
||||
assert.equal(moduleName, "myplugin");
|
||||
return {
|
||||
module: () => ({
|
||||
create(info: server.PluginCreateInfo) {
|
||||
const proxy = Harness.LanguageService.makeDefaultProxy(info);
|
||||
proxy.getSemanticDiagnostics = filename => {
|
||||
const prev = info.languageService.getSemanticDiagnostics(filename);
|
||||
const sourceFile: SourceFile = info.project.getSourceFile(toPath(filename, /*basePath*/ undefined, createGetCanonicalFileName(info.serverHost.useCaseSensitiveFileNames)))!;
|
||||
prev.push({
|
||||
category: DiagnosticCategory.Warning,
|
||||
file: sourceFile,
|
||||
code: 9999,
|
||||
length: 3,
|
||||
messageText: `Plugin diagnostic`,
|
||||
start: 0
|
||||
});
|
||||
return prev;
|
||||
};
|
||||
return proxy;
|
||||
}
|
||||
}),
|
||||
error: undefined
|
||||
};
|
||||
};
|
||||
const session = createSession(host, { globalPlugins: ["myplugin"] });
|
||||
|
||||
session.executeCommand(<protocol.OpenExternalProjectsRequest>{
|
||||
seq: 1,
|
||||
type: "request",
|
||||
command: "openExternalProjects",
|
||||
arguments: { projects: [p1] }
|
||||
});
|
||||
|
||||
const projectService = session.getProjectService();
|
||||
checkNumberOfProjects(projectService, { externalProjects: 1 });
|
||||
assert.equal(projectService.externalProjects[0].getProjectName(), p1.projectFileName);
|
||||
|
||||
const handlerResponse = session.executeCommand(<protocol.SemanticDiagnosticsSyncRequest>{
|
||||
seq: 2,
|
||||
type: "request",
|
||||
command: "semanticDiagnosticsSync",
|
||||
arguments: {
|
||||
file: f1.path,
|
||||
projectFileName: p1.projectFileName
|
||||
}
|
||||
});
|
||||
|
||||
assert.isDefined(handlerResponse.response);
|
||||
const response = handlerResponse.response as protocol.Diagnostic[];
|
||||
assert.equal(response.length, 1);
|
||||
assert.equal(response[0].text, "Plugin diagnostic");
|
||||
});
|
||||
|
||||
it("remove not-listed external projects", () => {
|
||||
const f1 = {
|
||||
path: "/a/app.ts",
|
||||
|
||||
+3
-1
@@ -14,7 +14,7 @@ and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
declare namespace ts {
|
||||
const versionMajorMinor = "3.4";
|
||||
const versionMajorMinor = "3.5";
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version: string;
|
||||
}
|
||||
@@ -6748,6 +6748,8 @@ declare namespace ts.server.protocol {
|
||||
command: CommandTypes.ConfigurePlugin;
|
||||
arguments: ConfigurePluginRequestArguments;
|
||||
}
|
||||
interface ConfigurePluginResponse extends Response {
|
||||
}
|
||||
/**
|
||||
* Information found in an "open" request.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
declare namespace ts {
|
||||
const versionMajorMinor = "3.4";
|
||||
const versionMajorMinor = "3.5";
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version: string;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,8 @@ var A = /** @class */ (function () {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
return __awaiter(_this, void 0, void 0, function () {
|
||||
var _a, obj;
|
||||
var obj;
|
||||
var _a;
|
||||
var _this = this;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
|
||||
@@ -6,7 +6,8 @@ var foo = async (): Promise<void> => {
|
||||
//// [asyncArrowFunction8_es5.js]
|
||||
var _this = this;
|
||||
var foo = function () { return __awaiter(_this, void 0, void 0, function () {
|
||||
var _a, v;
|
||||
var v;
|
||||
var _a;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
|
||||
@@ -6,7 +6,8 @@ async function foo(): Promise<void> {
|
||||
//// [asyncFunctionDeclaration9_es5.js]
|
||||
function foo() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a, v;
|
||||
var v;
|
||||
var _a;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
|
||||
@@ -3,8 +3,8 @@ export let [,,[,[],,[],]] = undefined as any;
|
||||
|
||||
//// [bindingPatternOmittedExpressionNesting.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var _a, _b, _c, _d;
|
||||
exports.__esModule = true;
|
||||
exports._e = (_a = undefined, _b = _a[2], _c = _b[1], _d = _b[3]);
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ var __values = (this && this.__values) || function (o) {
|
||||
};
|
||||
};
|
||||
function a() {
|
||||
var e_1, _a, _loop_1, _b, _c, i, e_1_1;
|
||||
var _loop_1, _a, _b, i, e_1_1;
|
||||
var e_1, _c;
|
||||
return __generator(this, function (_d) {
|
||||
switch (_d.label) {
|
||||
case 0:
|
||||
@@ -64,17 +65,17 @@ function a() {
|
||||
_d.label = 1;
|
||||
case 1:
|
||||
_d.trys.push([1, 6, 7, 8]);
|
||||
_b = __values([1, 2, 3]), _c = _b.next();
|
||||
_a = __values([1, 2, 3]), _b = _a.next();
|
||||
_d.label = 2;
|
||||
case 2:
|
||||
if (!!_c.done) return [3 /*break*/, 5];
|
||||
i = _c.value;
|
||||
if (!!_b.done) return [3 /*break*/, 5];
|
||||
i = _b.value;
|
||||
return [5 /*yield**/, _loop_1(i)];
|
||||
case 3:
|
||||
_d.sent();
|
||||
_d.label = 4;
|
||||
case 4:
|
||||
_c = _b.next();
|
||||
_b = _a.next();
|
||||
return [3 /*break*/, 2];
|
||||
case 5: return [3 /*break*/, 8];
|
||||
case 6:
|
||||
@@ -83,7 +84,7 @@ function a() {
|
||||
return [3 /*break*/, 8];
|
||||
case 7:
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
return [7 /*endfinally*/];
|
||||
|
||||
@@ -45,10 +45,14 @@ const myStoreConnect: Connect = function(
|
||||
mergeProps,
|
||||
options,
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
export {};
|
||||
|
||||
|
||||
//// [circularlySimplifyingConditionalTypesNoCrash.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var myStoreConnect = function (mapStateToProps, mapDispatchToProps, mergeProps, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
return connect(mapStateToProps, mapDispatchToProps, mergeProps, options);
|
||||
|
||||
@@ -152,3 +152,6 @@ const myStoreConnect: Connect = function(
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
export {};
|
||||
|
||||
|
||||
@@ -90,3 +90,6 @@ const myStoreConnect: Connect = function(
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
export {};
|
||||
|
||||
|
||||
@@ -148,9 +148,8 @@ _a = Math.pow(['', ''], value), '' = _a[0], '' = _a[1];
|
||||
var Derived = /** @class */ (function (_super) {
|
||||
__extends(Derived, _super);
|
||||
function Derived() {
|
||||
var _this = this;
|
||||
var _a;
|
||||
_this = _super.call(this) || this;
|
||||
var _this = _super.call(this) || this;
|
||||
(_a = _super.prototype). = Math.pow(_a., value);
|
||||
return _this;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ exports.__esModule = true;
|
||||
exports.Key = Symbol();
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var _a;
|
||||
exports.__esModule = true;
|
||||
var context_1 = require("./context");
|
||||
exports.context = (_a = {},
|
||||
_a[context_1.Key] = 'bar',
|
||||
|
||||
@@ -24,8 +24,8 @@ var EnumExample;
|
||||
exports["default"] = EnumExample;
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var _a;
|
||||
exports.__esModule = true;
|
||||
var EnumExample_1 = require("./EnumExample");
|
||||
exports["default"] = (_a = {},
|
||||
_a[EnumExample_1["default"].TEST] = {},
|
||||
|
||||
@@ -25,8 +25,8 @@ exports.__esModule = true;
|
||||
exports.x = Symbol();
|
||||
//// [b.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var _a;
|
||||
exports.__esModule = true;
|
||||
var a_1 = require("./a");
|
||||
var C = /** @class */ (function () {
|
||||
function C() {
|
||||
@@ -51,8 +51,8 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var _a;
|
||||
exports.__esModule = true;
|
||||
var a_1 = require("./a");
|
||||
var b_1 = require("./b");
|
||||
var D = /** @class */ (function (_super) {
|
||||
|
||||
@@ -25,8 +25,8 @@ exports.default = createExperiment({
|
||||
});
|
||||
//// [main.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var other_1 = require("./other");
|
||||
exports.obj = (_a = {},
|
||||
_a[other_1.default.name] = 1,
|
||||
|
||||
@@ -25,8 +25,8 @@ exports.default = createExperiment({
|
||||
});
|
||||
//// [main.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var other2 = require("./other");
|
||||
exports.obj = (_a = {},
|
||||
_a[other2.default.name] = 1,
|
||||
|
||||
@@ -14,8 +14,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Testing123_1;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let Testing123 = Testing123_1 = class Testing123 {
|
||||
};
|
||||
Testing123.prop1 = Testing123_1.prop0;
|
||||
|
||||
@@ -12,8 +12,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Testing123_1;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
let Testing123 = Testing123_1 = class Testing123 {
|
||||
};
|
||||
Testing123 = Testing123_1 = __decorate([
|
||||
|
||||
@@ -4,11 +4,11 @@ tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(21,6): error
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(22,13): error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(28,6): error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(34,15): error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(68,10): error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(69,10): error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(70,10): error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(75,15): error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(76,15): error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(68,10): error TS1258: Definite assignment assertions can only be used along with a type annotation.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(69,10): error TS1258: Definite assignment assertions can only be used along with a type annotation.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(70,10): error TS1258: Definite assignment assertions can only be used along with a type annotation.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(75,15): error TS1258: Definite assignment assertions can only be used along with a type annotation.
|
||||
tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(76,15): error TS1258: Definite assignment assertions can only be used along with a type annotation.
|
||||
|
||||
|
||||
==== tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts (11 errors) ====
|
||||
@@ -93,21 +93,21 @@ tests/cases/conformance/controlFlow/definiteAssignmentAssertions.ts(76,15): erro
|
||||
function f4() {
|
||||
let a!;
|
||||
~
|
||||
!!! error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
!!! error TS1258: Definite assignment assertions can only be used along with a type annotation.
|
||||
let b! = 1;
|
||||
~
|
||||
!!! error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
!!! error TS1258: Definite assignment assertions can only be used along with a type annotation.
|
||||
let c!: number = 1;
|
||||
~
|
||||
!!! error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
!!! error TS1258: Definite assignment assertions can only be used along with a type annotation.
|
||||
}
|
||||
|
||||
// Definite assignment assertion not permitted in ambient context
|
||||
|
||||
declare let v1!: number;
|
||||
~
|
||||
!!! error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
!!! error TS1258: Definite assignment assertions can only be used along with a type annotation.
|
||||
declare var v2!: number;
|
||||
~
|
||||
!!! error TS1255: A definite assignment assertion '!' is not permitted in this context.
|
||||
!!! error TS1258: Definite assignment assertions can only be used along with a type annotation.
|
||||
|
||||
@@ -44,8 +44,8 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var _a;
|
||||
exports.__esModule = true;
|
||||
exports.noPrivates = (_a = /** @class */ (function () {
|
||||
function class_1() {
|
||||
this.p = 12;
|
||||
|
||||
@@ -58,8 +58,8 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
};
|
||||
function f1() {
|
||||
var e_1, _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var e_1, _a;
|
||||
let y;
|
||||
try {
|
||||
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield y_1.next(), !y_1_1.done;) {
|
||||
@@ -92,8 +92,8 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
};
|
||||
function f2() {
|
||||
var e_1, _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var e_1, _a;
|
||||
let x, y;
|
||||
try {
|
||||
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield y_1.next(), !y_1_1.done;) {
|
||||
@@ -203,8 +203,8 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
||||
};
|
||||
// https://github.com/Microsoft/TypeScript/issues/21363
|
||||
function f5() {
|
||||
var e_1, _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var e_1, _a;
|
||||
let y;
|
||||
try {
|
||||
outer: for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield y_1.next(), !y_1_1.done;) {
|
||||
|
||||
@@ -85,8 +85,9 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
};
|
||||
function f1() {
|
||||
var e_1, _a;
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var e_1, _a, y, y_1, y_1_1, x, e_1_1;
|
||||
var y, y_1, y_1_1, x, e_1_1;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
@@ -165,8 +166,9 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
};
|
||||
function f2() {
|
||||
var e_1, _a;
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var e_1, _a, x, y, y_1, y_1_1, e_1_1;
|
||||
var x, y, y_1, y_1_1, e_1_1;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
@@ -250,7 +252,8 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
||||
};
|
||||
function f3() {
|
||||
return __asyncGenerator(this, arguments, function f3_1() {
|
||||
var e_1, _a, y, y_1, y_1_1, x, e_1_1;
|
||||
var y, y_1, y_1_1, x, e_1_1;
|
||||
var e_1, _a;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
@@ -334,7 +337,8 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
||||
};
|
||||
function f4() {
|
||||
return __asyncGenerator(this, arguments, function f4_1() {
|
||||
var e_1, _a, x, y, y_1, y_1_1, e_1_1;
|
||||
var x, y, y_1, y_1_1, e_1_1;
|
||||
var e_1, _a;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
@@ -414,8 +418,9 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
||||
};
|
||||
// https://github.com/Microsoft/TypeScript/issues/21363
|
||||
function f5() {
|
||||
var e_1, _a;
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var e_1, _a, y, y_1, y_1_1, x, e_1_1;
|
||||
var y, y_1, y_1_1, x, e_1_1;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
@@ -500,7 +505,8 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
||||
// https://github.com/Microsoft/TypeScript/issues/21363
|
||||
function f6() {
|
||||
return __asyncGenerator(this, arguments, function f6_1() {
|
||||
var e_1, _a, y, y_1, y_1_1, x, e_1_1;
|
||||
var y, y_1, y_1_1, x, e_1_1;
|
||||
var e_1, _a;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
|
||||
@@ -315,7 +315,8 @@ function forOfStatement10() {
|
||||
}
|
||||
function forOfStatement11() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a, _i, y_8, _b;
|
||||
var _i, y_8, _a;
|
||||
var _b;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
@@ -323,17 +324,17 @@ function forOfStatement11() {
|
||||
_c.label = 1;
|
||||
case 1:
|
||||
if (!(_i < y_8.length)) return [3 /*break*/, 6];
|
||||
_a = y_8[_i][0];
|
||||
if (!(_a === void 0)) return [3 /*break*/, 3];
|
||||
_b = y_8[_i][0];
|
||||
if (!(_b === void 0)) return [3 /*break*/, 3];
|
||||
return [4 /*yield*/, a];
|
||||
case 2:
|
||||
_b = _c.sent();
|
||||
_a = _c.sent();
|
||||
return [3 /*break*/, 4];
|
||||
case 3:
|
||||
_b = _a;
|
||||
_a = _b;
|
||||
_c.label = 4;
|
||||
case 4:
|
||||
x = _b;
|
||||
x = _a;
|
||||
z;
|
||||
_c.label = 5;
|
||||
case 5:
|
||||
@@ -346,18 +347,19 @@ function forOfStatement11() {
|
||||
}
|
||||
function forOfStatement12() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a, _i, _b;
|
||||
var _i, _a;
|
||||
var _b;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
_i = 0;
|
||||
return [4 /*yield*/, y];
|
||||
case 1:
|
||||
_b = _c.sent();
|
||||
_a = _c.sent();
|
||||
_c.label = 2;
|
||||
case 2:
|
||||
if (!(_i < _b.length)) return [3 /*break*/, 4];
|
||||
_a = _b[_i][0], x = _a === void 0 ? a : _a;
|
||||
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
||||
_b = _a[_i][0], x = _b === void 0 ? a : _b;
|
||||
z;
|
||||
_c.label = 3;
|
||||
case 3:
|
||||
@@ -370,7 +372,8 @@ function forOfStatement12() {
|
||||
}
|
||||
function forOfStatement13() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a, _i, y_9;
|
||||
var _i, y_9;
|
||||
var _a;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
@@ -440,7 +443,8 @@ function forOfStatement15() {
|
||||
}
|
||||
function forOfStatement16() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a, _i, y_11, _b;
|
||||
var _i, y_11, _a;
|
||||
var _b;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
@@ -448,17 +452,17 @@ function forOfStatement16() {
|
||||
_c.label = 1;
|
||||
case 1:
|
||||
if (!(_i < y_11.length)) return [3 /*break*/, 6];
|
||||
_a = y_11[_i].x;
|
||||
if (!(_a === void 0)) return [3 /*break*/, 3];
|
||||
_b = y_11[_i].x;
|
||||
if (!(_b === void 0)) return [3 /*break*/, 3];
|
||||
return [4 /*yield*/, a];
|
||||
case 2:
|
||||
_b = _c.sent();
|
||||
_a = _c.sent();
|
||||
return [3 /*break*/, 4];
|
||||
case 3:
|
||||
_b = _a;
|
||||
_a = _b;
|
||||
_c.label = 4;
|
||||
case 4:
|
||||
x = _b;
|
||||
x = _a;
|
||||
z;
|
||||
_c.label = 5;
|
||||
case 5:
|
||||
@@ -471,18 +475,19 @@ function forOfStatement16() {
|
||||
}
|
||||
function forOfStatement17() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a, _i, _b;
|
||||
var _i, _a;
|
||||
var _b;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
_i = 0;
|
||||
return [4 /*yield*/, y];
|
||||
case 1:
|
||||
_b = _c.sent();
|
||||
_a = _c.sent();
|
||||
_c.label = 2;
|
||||
case 2:
|
||||
if (!(_i < _b.length)) return [3 /*break*/, 4];
|
||||
_a = _b[_i].x, x = _a === void 0 ? a : _a;
|
||||
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
||||
_b = _a[_i].x, x = _b === void 0 ? a : _b;
|
||||
z;
|
||||
_c.label = 3;
|
||||
case 3:
|
||||
@@ -495,7 +500,8 @@ function forOfStatement17() {
|
||||
}
|
||||
function forOfStatement18() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a, _i, y_12;
|
||||
var _i, y_12;
|
||||
var _a;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
|
||||
@@ -105,17 +105,18 @@ function objectLiteral2() {
|
||||
}
|
||||
function objectLiteral3() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a, _b;
|
||||
var _a;
|
||||
var _b;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
_a = {};
|
||||
_b = a;
|
||||
_b = {};
|
||||
_a = a;
|
||||
return [4 /*yield*/, y];
|
||||
case 1:
|
||||
x = (_a[_b] = _c.sent(),
|
||||
_a.b = z,
|
||||
_a);
|
||||
x = (_b[_a] = _c.sent(),
|
||||
_b.b = z,
|
||||
_b);
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
@@ -158,18 +159,19 @@ function objectLiteral5() {
|
||||
}
|
||||
function objectLiteral6() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a, _b;
|
||||
var _a;
|
||||
var _b;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
_a = {
|
||||
_b = {
|
||||
a: y
|
||||
};
|
||||
_b = b;
|
||||
_a = b;
|
||||
return [4 /*yield*/, z];
|
||||
case 1:
|
||||
x = (_a[_b] = _c.sent(),
|
||||
_a);
|
||||
x = (_b[_a] = _c.sent(),
|
||||
_b);
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
|
||||
@@ -8,8 +8,10 @@ type Omit1<U, K extends keyof U> = Pick<U, Diff<keyof U, K>>;
|
||||
type Omit2<T, K extends keyof T> = {[P in Diff<keyof T, K>]: T[P]};
|
||||
|
||||
type O = Omit<{ a: number, b: string }, 'a'>
|
||||
const o: O = { b: '' }
|
||||
export const o: O = { b: '' }
|
||||
|
||||
|
||||
//// [indexedAccessRetainsIndexSignature.js]
|
||||
var o = { b: '' };
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.o = { b: '' };
|
||||
|
||||
@@ -55,8 +55,8 @@ type O = Omit<{ a: number, b: string }, 'a'>
|
||||
>a : Symbol(a, Decl(indexedAccessRetainsIndexSignature.ts, 8, 15))
|
||||
>b : Symbol(b, Decl(indexedAccessRetainsIndexSignature.ts, 8, 26))
|
||||
|
||||
const o: O = { b: '' }
|
||||
>o : Symbol(o, Decl(indexedAccessRetainsIndexSignature.ts, 9, 5))
|
||||
export const o: O = { b: '' }
|
||||
>o : Symbol(o, Decl(indexedAccessRetainsIndexSignature.ts, 9, 12))
|
||||
>O : Symbol(O, Decl(indexedAccessRetainsIndexSignature.ts, 6, 67))
|
||||
>b : Symbol(b, Decl(indexedAccessRetainsIndexSignature.ts, 9, 14))
|
||||
>b : Symbol(b, Decl(indexedAccessRetainsIndexSignature.ts, 9, 21))
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ type O = Omit<{ a: number, b: string }, 'a'>
|
||||
>a : number
|
||||
>b : string
|
||||
|
||||
const o: O = { b: '' }
|
||||
export const o: O = { b: '' }
|
||||
>o : Pick<{ a: number; b: string; }, "b">
|
||||
>{ b: '' } : { b: string; }
|
||||
>b : string
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
tests/cases/compiler/a.js(1,9): error TS2339: Property 'a' does not exist on type 'typeof import("tests/cases/compiler/a")'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
exports.a.b.c = 0;
|
||||
~
|
||||
!!! error TS2339: Property 'a' does not exist on type 'typeof import("tests/cases/compiler/a")'.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/a.js ===
|
||||
exports.a.b.c = 0;
|
||||
>exports : Symbol("tests/cases/compiler/a", Decl(a.js, 0, 0))
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/a.js ===
|
||||
exports.a.b.c = 0;
|
||||
>exports.a.b.c = 0 : 0
|
||||
>exports.a.b.c : any
|
||||
>exports.a.b : any
|
||||
>exports.a : any
|
||||
>exports : typeof import("tests/cases/compiler/a")
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
>0 : 0
|
||||
|
||||
@@ -9,8 +9,8 @@ export const Baa = {
|
||||
|
||||
//// [objectLiteralComputedNameNoDeclarationError.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var _a;
|
||||
exports.__esModule = true;
|
||||
var Foo = {
|
||||
BANANA: 'banana'
|
||||
};
|
||||
|
||||
@@ -143,6 +143,8 @@ const Test1 = connect(
|
||||
null,
|
||||
mapDispatchToProps
|
||||
)(TestComponent);
|
||||
|
||||
export {};
|
||||
|
||||
|
||||
//// [reactReduxLikeDeferredInferenceAllowsAssignment.js]
|
||||
@@ -196,6 +198,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
}
|
||||
};
|
||||
var _this = this;
|
||||
exports.__esModule = true;
|
||||
var simpleAction = function (payload) { return ({
|
||||
type: "SIMPLE_ACTION",
|
||||
payload: payload
|
||||
|
||||
@@ -469,3 +469,5 @@ const Test1 = connect(
|
||||
)(TestComponent);
|
||||
>TestComponent : Symbol(TestComponent, Decl(reactReduxLikeDeferredInferenceAllowsAssignment.ts, 134, 1))
|
||||
|
||||
export {};
|
||||
|
||||
|
||||
@@ -286,3 +286,5 @@ const Test1 = connect(
|
||||
)(TestComponent);
|
||||
>TestComponent : typeof TestComponent
|
||||
|
||||
export {};
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
//// [restParameterInDownlevelGenerator.ts]
|
||||
// https://github.com/Microsoft/TypeScript/issues/30653
|
||||
function * mergeStringLists(...strings: string[]) {
|
||||
for (var str of strings);
|
||||
}
|
||||
|
||||
//// [restParameterInDownlevelGenerator.js]
|
||||
// https://github.com/Microsoft/TypeScript/issues/30653
|
||||
function mergeStringLists() {
|
||||
var _i, strings_1, strings_1_1, str;
|
||||
var e_1, _a;
|
||||
var strings = [];
|
||||
for (_i = 0; _i < arguments.length; _i++) {
|
||||
strings[_i] = arguments[_i];
|
||||
}
|
||||
return __generator(this, function (_b) {
|
||||
try {
|
||||
for (strings_1 = __values(strings), strings_1_1 = strings_1.next(); !strings_1_1.done; strings_1_1 = strings_1.next()) {
|
||||
str = strings_1_1.value;
|
||||
;
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (strings_1_1 && !strings_1_1.done && (_a = strings_1.return)) _a.call(strings_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return [2 /*return*/];
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/conformance/generators/restParameterInDownlevelGenerator.ts ===
|
||||
// https://github.com/Microsoft/TypeScript/issues/30653
|
||||
function * mergeStringLists(...strings: string[]) {
|
||||
>mergeStringLists : Symbol(mergeStringLists, Decl(restParameterInDownlevelGenerator.ts, 0, 0))
|
||||
>strings : Symbol(strings, Decl(restParameterInDownlevelGenerator.ts, 1, 28))
|
||||
|
||||
for (var str of strings);
|
||||
>str : Symbol(str, Decl(restParameterInDownlevelGenerator.ts, 2, 12))
|
||||
>strings : Symbol(strings, Decl(restParameterInDownlevelGenerator.ts, 1, 28))
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/conformance/generators/restParameterInDownlevelGenerator.ts ===
|
||||
// https://github.com/Microsoft/TypeScript/issues/30653
|
||||
function * mergeStringLists(...strings: string[]) {
|
||||
>mergeStringLists : (...strings: string[]) => IterableIterator<any>
|
||||
>strings : string[]
|
||||
|
||||
for (var str of strings);
|
||||
>str : string
|
||||
>strings : string[]
|
||||
}
|
||||
+573
@@ -0,0 +1,573 @@
|
||||
//// [/src/app/file3.ts]
|
||||
export const z = 30;
|
||||
import { x } from "lib/file1";
|
||||
|
||||
//// [/src/app/module.d.ts]
|
||||
declare const myGlob = 20;
|
||||
declare module "lib/file1" {
|
||||
export const x = 10;
|
||||
}
|
||||
declare module "lib/file2" {
|
||||
export const y = 20;
|
||||
}
|
||||
declare const globalConst = 10;
|
||||
declare module "file3" {
|
||||
export const z = 30;
|
||||
}
|
||||
declare const myVar = 30;
|
||||
//# sourceMappingURL=module.d.ts.map
|
||||
|
||||
//// [/src/app/module.d.ts.map]
|
||||
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../lib/file0.ts","../lib/file1.ts","../lib/file2.ts","../lib/global.ts","file3.ts","file4.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM,KAAK,CAAC;;ICAlB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;;ICApB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,WAAW,KAAK,CAAC;;ICAvB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,KAAK,KAAK,CAAC"}
|
||||
|
||||
//// [/src/app/module.d.ts.map.baseline.txt]
|
||||
===================================================================
|
||||
JsFile: module.d.ts
|
||||
mapUrl: module.d.ts.map
|
||||
sourceRoot:
|
||||
sources: ../lib/file0.ts,../lib/file1.ts,../lib/file2.ts,../lib/global.ts,file3.ts,file4.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.d.ts
|
||||
sourceFile:../lib/file0.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>declare const myGlob = 20;
|
||||
1 >
|
||||
2 >^^^^^^^^
|
||||
3 > ^^^^^^
|
||||
4 > ^^^^^^
|
||||
5 > ^^^^^
|
||||
6 > ^
|
||||
7 > ^^^->
|
||||
1 >
|
||||
2 >
|
||||
3 > const
|
||||
4 > myGlob
|
||||
5 > = 20
|
||||
6 > ;
|
||||
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 9) Source(1, 1) + SourceIndex(0)
|
||||
3 >Emitted(1, 15) Source(1, 7) + SourceIndex(0)
|
||||
4 >Emitted(1, 21) Source(1, 13) + SourceIndex(0)
|
||||
5 >Emitted(1, 26) Source(1, 18) + SourceIndex(0)
|
||||
6 >Emitted(1, 27) Source(1, 19) + SourceIndex(0)
|
||||
---
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.d.ts
|
||||
sourceFile:../lib/file1.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>declare module "lib/file1" {
|
||||
>>> export const x = 10;
|
||||
1->^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^^^^
|
||||
5 > ^
|
||||
6 > ^^^^^
|
||||
7 > ^
|
||||
1->
|
||||
2 > export
|
||||
3 >
|
||||
4 > const
|
||||
5 > x
|
||||
6 > = 10
|
||||
7 > ;
|
||||
1->Emitted(3, 5) Source(1, 1) + SourceIndex(1)
|
||||
2 >Emitted(3, 11) Source(1, 7) + SourceIndex(1)
|
||||
3 >Emitted(3, 12) Source(1, 8) + SourceIndex(1)
|
||||
4 >Emitted(3, 18) Source(1, 14) + SourceIndex(1)
|
||||
5 >Emitted(3, 19) Source(1, 15) + SourceIndex(1)
|
||||
6 >Emitted(3, 24) Source(1, 20) + SourceIndex(1)
|
||||
7 >Emitted(3, 25) Source(1, 21) + SourceIndex(1)
|
||||
---
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.d.ts
|
||||
sourceFile:../lib/file2.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>}
|
||||
>>>declare module "lib/file2" {
|
||||
>>> export const y = 20;
|
||||
1 >^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^^^^
|
||||
5 > ^
|
||||
6 > ^^^^^
|
||||
7 > ^
|
||||
1 >
|
||||
2 > export
|
||||
3 >
|
||||
4 > const
|
||||
5 > y
|
||||
6 > = 20
|
||||
7 > ;
|
||||
1 >Emitted(6, 5) Source(1, 1) + SourceIndex(2)
|
||||
2 >Emitted(6, 11) Source(1, 7) + SourceIndex(2)
|
||||
3 >Emitted(6, 12) Source(1, 8) + SourceIndex(2)
|
||||
4 >Emitted(6, 18) Source(1, 14) + SourceIndex(2)
|
||||
5 >Emitted(6, 19) Source(1, 15) + SourceIndex(2)
|
||||
6 >Emitted(6, 24) Source(1, 20) + SourceIndex(2)
|
||||
7 >Emitted(6, 25) Source(1, 21) + SourceIndex(2)
|
||||
---
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.d.ts
|
||||
sourceFile:../lib/global.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>}
|
||||
>>>declare const globalConst = 10;
|
||||
1 >
|
||||
2 >^^^^^^^^
|
||||
3 > ^^^^^^
|
||||
4 > ^^^^^^^^^^^
|
||||
5 > ^^^^^
|
||||
6 > ^
|
||||
1 >
|
||||
2 >
|
||||
3 > const
|
||||
4 > globalConst
|
||||
5 > = 10
|
||||
6 > ;
|
||||
1 >Emitted(8, 1) Source(1, 1) + SourceIndex(3)
|
||||
2 >Emitted(8, 9) Source(1, 1) + SourceIndex(3)
|
||||
3 >Emitted(8, 15) Source(1, 7) + SourceIndex(3)
|
||||
4 >Emitted(8, 26) Source(1, 18) + SourceIndex(3)
|
||||
5 >Emitted(8, 31) Source(1, 23) + SourceIndex(3)
|
||||
6 >Emitted(8, 32) Source(1, 24) + SourceIndex(3)
|
||||
---
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.d.ts
|
||||
sourceFile:file3.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>declare module "file3" {
|
||||
>>> export const z = 30;
|
||||
1 >^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^^^^
|
||||
5 > ^
|
||||
6 > ^^^^^
|
||||
7 > ^
|
||||
1 >
|
||||
2 > export
|
||||
3 >
|
||||
4 > const
|
||||
5 > z
|
||||
6 > = 30
|
||||
7 > ;
|
||||
1 >Emitted(10, 5) Source(1, 1) + SourceIndex(4)
|
||||
2 >Emitted(10, 11) Source(1, 7) + SourceIndex(4)
|
||||
3 >Emitted(10, 12) Source(1, 8) + SourceIndex(4)
|
||||
4 >Emitted(10, 18) Source(1, 14) + SourceIndex(4)
|
||||
5 >Emitted(10, 19) Source(1, 15) + SourceIndex(4)
|
||||
6 >Emitted(10, 24) Source(1, 20) + SourceIndex(4)
|
||||
7 >Emitted(10, 25) Source(1, 21) + SourceIndex(4)
|
||||
---
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.d.ts
|
||||
sourceFile:file4.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>}
|
||||
>>>declare const myVar = 30;
|
||||
1 >
|
||||
2 >^^^^^^^^
|
||||
3 > ^^^^^^
|
||||
4 > ^^^^^
|
||||
5 > ^^^^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^^^->
|
||||
1 >
|
||||
2 >
|
||||
3 > const
|
||||
4 > myVar
|
||||
5 > = 30
|
||||
6 > ;
|
||||
1 >Emitted(12, 1) Source(1, 1) + SourceIndex(5)
|
||||
2 >Emitted(12, 9) Source(1, 1) + SourceIndex(5)
|
||||
3 >Emitted(12, 15) Source(1, 7) + SourceIndex(5)
|
||||
4 >Emitted(12, 20) Source(1, 12) + SourceIndex(5)
|
||||
5 >Emitted(12, 25) Source(1, 17) + SourceIndex(5)
|
||||
6 >Emitted(12, 26) Source(1, 18) + SourceIndex(5)
|
||||
---
|
||||
>>>//# sourceMappingURL=module.d.ts.map
|
||||
|
||||
//// [/src/app/module.js]
|
||||
var myGlob = 20;
|
||||
define("lib/file1", ["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.x = 10;
|
||||
});
|
||||
define("lib/file2", ["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.y = 20;
|
||||
});
|
||||
var globalConst = 10;
|
||||
define("file3", ["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.z = 30;
|
||||
});
|
||||
var myVar = 30;
|
||||
//# sourceMappingURL=module.js.map
|
||||
|
||||
//// [/src/app/module.js.map]
|
||||
{"version":3,"file":"module.js","sourceRoot":"","sources":["../lib/file0.ts","../lib/file1.ts","../lib/file2.ts","../lib/global.ts","file3.ts","file4.ts"],"names":[],"mappings":"AAAA,IAAM,MAAM,GAAG,EAAE,CAAC;;;;ICAL,QAAA,CAAC,GAAG,EAAE,CAAC;;;;;ICAP,QAAA,CAAC,GAAG,EAAE,CAAC;;ACApB,IAAM,WAAW,GAAG,EAAE,CAAC;;;;ICAV,QAAA,CAAC,GAAG,EAAE,CAAC;;ACApB,IAAM,KAAK,GAAG,EAAE,CAAC"}
|
||||
|
||||
//// [/src/app/module.js.map.baseline.txt]
|
||||
===================================================================
|
||||
JsFile: module.js
|
||||
mapUrl: module.js.map
|
||||
sourceRoot:
|
||||
sources: ../lib/file0.ts,../lib/file1.ts,../lib/file2.ts,../lib/global.ts,file3.ts,file4.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.js
|
||||
sourceFile:../lib/file0.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>var myGlob = 20;
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^^^^^^
|
||||
4 > ^^^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >const
|
||||
3 > myGlob
|
||||
4 > =
|
||||
5 > 20
|
||||
6 > ;
|
||||
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0)
|
||||
3 >Emitted(1, 11) Source(1, 13) + SourceIndex(0)
|
||||
4 >Emitted(1, 14) Source(1, 16) + SourceIndex(0)
|
||||
5 >Emitted(1, 16) Source(1, 18) + SourceIndex(0)
|
||||
6 >Emitted(1, 17) Source(1, 19) + SourceIndex(0)
|
||||
---
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.js
|
||||
sourceFile:../lib/file1.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>define("lib/file1", ["require", "exports"], function (require, exports) {
|
||||
>>> "use strict";
|
||||
>>> Object.defineProperty(exports, "__esModule", { value: true });
|
||||
>>> exports.x = 10;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
1->export const
|
||||
2 >
|
||||
3 > x
|
||||
4 > =
|
||||
5 > 10
|
||||
6 > ;
|
||||
1->Emitted(5, 5) Source(1, 14) + SourceIndex(1)
|
||||
2 >Emitted(5, 13) Source(1, 14) + SourceIndex(1)
|
||||
3 >Emitted(5, 14) Source(1, 15) + SourceIndex(1)
|
||||
4 >Emitted(5, 17) Source(1, 18) + SourceIndex(1)
|
||||
5 >Emitted(5, 19) Source(1, 20) + SourceIndex(1)
|
||||
6 >Emitted(5, 20) Source(1, 21) + SourceIndex(1)
|
||||
---
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.js
|
||||
sourceFile:../lib/file2.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>});
|
||||
>>>define("lib/file2", ["require", "exports"], function (require, exports) {
|
||||
>>> "use strict";
|
||||
>>> Object.defineProperty(exports, "__esModule", { value: true });
|
||||
>>> exports.y = 20;
|
||||
1 >^^^^
|
||||
2 > ^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
1 >export const
|
||||
2 >
|
||||
3 > y
|
||||
4 > =
|
||||
5 > 20
|
||||
6 > ;
|
||||
1 >Emitted(10, 5) Source(1, 14) + SourceIndex(2)
|
||||
2 >Emitted(10, 13) Source(1, 14) + SourceIndex(2)
|
||||
3 >Emitted(10, 14) Source(1, 15) + SourceIndex(2)
|
||||
4 >Emitted(10, 17) Source(1, 18) + SourceIndex(2)
|
||||
5 >Emitted(10, 19) Source(1, 20) + SourceIndex(2)
|
||||
6 >Emitted(10, 20) Source(1, 21) + SourceIndex(2)
|
||||
---
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.js
|
||||
sourceFile:../lib/global.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>});
|
||||
>>>var globalConst = 10;
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^^^^^^^^^^^
|
||||
4 > ^^^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >const
|
||||
3 > globalConst
|
||||
4 > =
|
||||
5 > 10
|
||||
6 > ;
|
||||
1 >Emitted(12, 1) Source(1, 1) + SourceIndex(3)
|
||||
2 >Emitted(12, 5) Source(1, 7) + SourceIndex(3)
|
||||
3 >Emitted(12, 16) Source(1, 18) + SourceIndex(3)
|
||||
4 >Emitted(12, 19) Source(1, 21) + SourceIndex(3)
|
||||
5 >Emitted(12, 21) Source(1, 23) + SourceIndex(3)
|
||||
6 >Emitted(12, 22) Source(1, 24) + SourceIndex(3)
|
||||
---
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.js
|
||||
sourceFile:file3.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>define("file3", ["require", "exports"], function (require, exports) {
|
||||
>>> "use strict";
|
||||
>>> Object.defineProperty(exports, "__esModule", { value: true });
|
||||
>>> exports.z = 30;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
1->export const
|
||||
2 >
|
||||
3 > z
|
||||
4 > =
|
||||
5 > 30
|
||||
6 > ;
|
||||
1->Emitted(16, 5) Source(1, 14) + SourceIndex(4)
|
||||
2 >Emitted(16, 13) Source(1, 14) + SourceIndex(4)
|
||||
3 >Emitted(16, 14) Source(1, 15) + SourceIndex(4)
|
||||
4 >Emitted(16, 17) Source(1, 18) + SourceIndex(4)
|
||||
5 >Emitted(16, 19) Source(1, 20) + SourceIndex(4)
|
||||
6 >Emitted(16, 20) Source(1, 21) + SourceIndex(4)
|
||||
---
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:/src/app/module.js
|
||||
sourceFile:file4.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>});
|
||||
>>>var myVar = 30;
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^^^^^
|
||||
4 > ^^^
|
||||
5 > ^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >const
|
||||
3 > myVar
|
||||
4 > =
|
||||
5 > 30
|
||||
6 > ;
|
||||
1 >Emitted(18, 1) Source(1, 1) + SourceIndex(5)
|
||||
2 >Emitted(18, 5) Source(1, 7) + SourceIndex(5)
|
||||
3 >Emitted(18, 10) Source(1, 12) + SourceIndex(5)
|
||||
4 >Emitted(18, 13) Source(1, 15) + SourceIndex(5)
|
||||
5 >Emitted(18, 15) Source(1, 17) + SourceIndex(5)
|
||||
6 >Emitted(18, 16) Source(1, 18) + SourceIndex(5)
|
||||
---
|
||||
>>>//# sourceMappingURL=module.js.map
|
||||
|
||||
//// [/src/app/module.tsbuildinfo]
|
||||
{
|
||||
"bundle": {
|
||||
"commonSourceDirectory": "/src/app/",
|
||||
"sourceFiles": [
|
||||
"/src/app/file3.ts",
|
||||
"/src/app/file4.ts"
|
||||
],
|
||||
"js": {
|
||||
"sections": [
|
||||
{
|
||||
"pos": 0,
|
||||
"end": 417,
|
||||
"kind": "prepend",
|
||||
"data": "/src/module.js",
|
||||
"texts": [
|
||||
{
|
||||
"pos": 0,
|
||||
"end": 417,
|
||||
"kind": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pos": 417,
|
||||
"end": 618,
|
||||
"kind": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"dts": {
|
||||
"sections": [
|
||||
{
|
||||
"pos": 0,
|
||||
"end": 179,
|
||||
"kind": "prepend",
|
||||
"data": "/src/module.d.ts",
|
||||
"texts": [
|
||||
{
|
||||
"pos": 0,
|
||||
"end": 179,
|
||||
"kind": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pos": 179,
|
||||
"end": 261,
|
||||
"kind": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "FakeTSVersion"
|
||||
}
|
||||
|
||||
//// [/src/app/module.tsbuildinfo.baseline.txt]
|
||||
======================================================================
|
||||
File:: /src/app/module.js
|
||||
----------------------------------------------------------------------
|
||||
prepend: (0-417):: /src/module.js texts:: 1
|
||||
>>--------------------------------------------------------------------
|
||||
text: (0-417)
|
||||
var myGlob = 20;
|
||||
define("lib/file1", ["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.x = 10;
|
||||
});
|
||||
define("lib/file2", ["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.y = 20;
|
||||
});
|
||||
var globalConst = 10;
|
||||
|
||||
----------------------------------------------------------------------
|
||||
text: (417-618)
|
||||
define("file3", ["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.z = 30;
|
||||
});
|
||||
var myVar = 30;
|
||||
|
||||
======================================================================
|
||||
======================================================================
|
||||
File:: /src/app/module.d.ts
|
||||
----------------------------------------------------------------------
|
||||
prepend: (0-179):: /src/module.d.ts texts:: 1
|
||||
>>--------------------------------------------------------------------
|
||||
text: (0-179)
|
||||
declare const myGlob = 20;
|
||||
declare module "lib/file1" {
|
||||
export const x = 10;
|
||||
}
|
||||
declare module "lib/file2" {
|
||||
export const y = 20;
|
||||
}
|
||||
declare const globalConst = 10;
|
||||
|
||||
----------------------------------------------------------------------
|
||||
text: (179-261)
|
||||
declare module "file3" {
|
||||
export const z = 30;
|
||||
}
|
||||
declare const myVar = 30;
|
||||
|
||||
======================================================================
|
||||
|
||||
//// [/src/lib/tsconfig.json]
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "amd",
|
||||
"composite": true,
|
||||
"sourceMap": true,
|
||||
"declarationMap": true,
|
||||
"strict": false,
|
||||
"outFile": "../module.js", "rootDir": "../"
|
||||
},
|
||||
"exclude": ["module.d.ts"]
|
||||
|
||||
}
|
||||
|
||||
//// [/src/module.d.ts]
|
||||
declare const myGlob = 20;
|
||||
declare module "lib/file1" {
|
||||
export const x = 10;
|
||||
}
|
||||
declare module "lib/file2" {
|
||||
export const y = 20;
|
||||
}
|
||||
declare const globalConst = 10;
|
||||
//# sourceMappingURL=module.d.ts.map
|
||||
|
||||
//// [/src/module.d.ts.map]
|
||||
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["lib/file0.ts","lib/file1.ts","lib/file2.ts","lib/global.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM,KAAK,CAAC;;ICAlB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;;ICApB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,WAAW,KAAK,CAAC"}
|
||||
|
||||
//// [/src/module.js]
|
||||
var myGlob = 20;
|
||||
define("lib/file1", ["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.x = 10;
|
||||
});
|
||||
define("lib/file2", ["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.y = 20;
|
||||
});
|
||||
var globalConst = 10;
|
||||
//# sourceMappingURL=module.js.map
|
||||
|
||||
//// [/src/module.js.map]
|
||||
{"version":3,"file":"module.js","sourceRoot":"","sources":["lib/file0.ts","lib/file1.ts","lib/file2.ts","lib/global.ts"],"names":[],"mappings":"AAAA,IAAM,MAAM,GAAG,EAAE,CAAC;;;;ICAL,QAAA,CAAC,GAAG,EAAE,CAAC;;;;;ICAP,QAAA,CAAC,GAAG,EAAE,CAAC;;ACApB,IAAM,WAAW,GAAG,EAAE,CAAC"}
|
||||
|
||||
//// [/src/module.tsbuildinfo]
|
||||
{
|
||||
"bundle": {
|
||||
"commonSourceDirectory": "/src/",
|
||||
"sourceFiles": [
|
||||
"/src/lib/file0.ts",
|
||||
"/src/lib/file1.ts",
|
||||
"/src/lib/file2.ts",
|
||||
"/src/lib/global.ts"
|
||||
],
|
||||
"js": {
|
||||
"sections": [
|
||||
{
|
||||
"pos": 0,
|
||||
"end": 417,
|
||||
"kind": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"dts": {
|
||||
"sections": [
|
||||
{
|
||||
"pos": 0,
|
||||
"end": 179,
|
||||
"kind": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "FakeTSVersion"
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ let b: I = {[SYM]: 'str'}; // Expect error
|
||||
|
||||
//// [uniqueSymbolAllowsIndexInObjectWithIndexSignature.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var _a, _b;
|
||||
exports.__esModule = true;
|
||||
// https://github.com/Microsoft/TypeScript/issues/21962
|
||||
exports.SYM = Symbol('a unique symbol');
|
||||
var a = (_a = {}, _a[exports.SYM] = 'sym', _a); // Expect ok
|
||||
|
||||
+1
-1
@@ -7,8 +7,8 @@ export class Foo {
|
||||
|
||||
//// [variableDeclarationDeclarationEmitUniqueSymbolPartialStatement.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var _a;
|
||||
exports.__esModule = true;
|
||||
var key = Symbol(), value = 12;
|
||||
var Foo = /** @class */ (function () {
|
||||
function Foo() {
|
||||
|
||||
@@ -45,4 +45,6 @@ const myStoreConnect: Connect = function(
|
||||
mergeProps,
|
||||
options,
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
export {};
|
||||
|
||||
@@ -7,4 +7,4 @@ type Omit1<U, K extends keyof U> = Pick<U, Diff<keyof U, K>>;
|
||||
type Omit2<T, K extends keyof T> = {[P in Diff<keyof T, K>]: T[P]};
|
||||
|
||||
type O = Omit<{ a: number, b: string }, 'a'>
|
||||
const o: O = { b: '' }
|
||||
export const o: O = { b: '' }
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// @allowJs: true
|
||||
// @noEmit: true
|
||||
// @checkJs: true
|
||||
// @filename: a.js
|
||||
|
||||
exports.a.b.c = 0;
|
||||
@@ -143,3 +143,5 @@ const Test1 = connect(
|
||||
null,
|
||||
mapDispatchToProps
|
||||
)(TestComponent);
|
||||
|
||||
export {};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// @target: es5
|
||||
// @lib: es2015
|
||||
// @downlevelIteration: true
|
||||
// @noEmitHelpers: true
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/issues/30653
|
||||
function * mergeStringLists(...strings: string[]) {
|
||||
for (var str of strings);
|
||||
}
|
||||
Reference in New Issue
Block a user