mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into tsbuild
This commit is contained in:
@@ -56,13 +56,13 @@ function updateTsFile(tsFilePath: string, tsFileContents: string, majorMinor: st
|
||||
const majorMinorRgx = /export const versionMajorMinor = "(\d+\.\d+)"/;
|
||||
const majorMinorMatch = majorMinorRgx.exec(tsFileContents);
|
||||
assert(majorMinorMatch !== null, `The file seems to no longer have a string matching '${majorMinorRgx}'.`);
|
||||
const parsedMajorMinor = majorMinorMatch[1];
|
||||
const parsedMajorMinor = majorMinorMatch![1];
|
||||
assert(parsedMajorMinor === majorMinor, `versionMajorMinor does not match. ${tsFilePath}: '${parsedMajorMinor}'; package.json: '${majorMinor}'`);
|
||||
|
||||
const versionRgx = /export const version = `\$\{versionMajorMinor\}\.(\d)(-dev)?`;/;
|
||||
const patchMatch = versionRgx.exec(tsFileContents);
|
||||
assert(patchMatch !== null, "The file seems to no longer have a string matching " + versionRgx.toString());
|
||||
const parsedPatch = patchMatch[1];
|
||||
const parsedPatch = patchMatch![1];
|
||||
if (parsedPatch !== patch) {
|
||||
throw new Error(`patch does not match. ${tsFilePath}: '${parsedPatch}; package.json: '${patch}'`);
|
||||
}
|
||||
@@ -74,7 +74,7 @@ function parsePackageJsonVersion(versionString: string): { majorMinor: string, p
|
||||
const versionRgx = /(\d+\.\d+)\.(\d+)($|\-)/;
|
||||
const match = versionString.match(versionRgx);
|
||||
assert(match !== null, "package.json 'version' should match " + versionRgx.toString());
|
||||
return { majorMinor: match[1], patch: match[2] };
|
||||
return { majorMinor: match![1], patch: match![2] };
|
||||
}
|
||||
|
||||
/** e.g. 0-dev.20170707 */
|
||||
|
||||
@@ -52,8 +52,8 @@ function walk(ctx: Lint.WalkContext<void>, checkCatch: boolean, checkElse: boole
|
||||
return;
|
||||
}
|
||||
|
||||
const tryClosingBrace = tryBlock.getLastToken(sourceFile);
|
||||
const catchKeyword = catchClause.getFirstToken(sourceFile);
|
||||
const tryClosingBrace = tryBlock.getLastToken(sourceFile)!;
|
||||
const catchKeyword = catchClause.getFirstToken(sourceFile)!;
|
||||
const tryClosingBraceLoc = sourceFile.getLineAndCharacterOfPosition(tryClosingBrace.getEnd());
|
||||
const catchKeywordLoc = sourceFile.getLineAndCharacterOfPosition(catchKeyword.getStart(sourceFile));
|
||||
if (tryClosingBraceLoc.line === catchKeywordLoc.line) {
|
||||
|
||||
@@ -12,7 +12,7 @@ export class Rule extends Lint.Rules.AbstractRule {
|
||||
function walk(ctx: Lint.WalkContext<void>): void {
|
||||
ts.forEachChild(ctx.sourceFile, recur);
|
||||
function recur(node: ts.Node): void {
|
||||
if (node.kind === ts.SyntaxKind.InKeyword && node.parent!.kind === ts.SyntaxKind.BinaryExpression) {
|
||||
if (node.kind === ts.SyntaxKind.InKeyword && node.parent.kind === ts.SyntaxKind.BinaryExpression) {
|
||||
ctx.addFailureAtNode(node, Rule.FAILURE_STRING);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ function walk(ctx: Lint.WalkContext<void>): void {
|
||||
}
|
||||
|
||||
function check(node: ts.UnaryExpression): void {
|
||||
if (!isAllowedLocation(node.parent!)) {
|
||||
if (!isAllowedLocation(node.parent)) {
|
||||
ctx.addFailureAtNode(node, Rule.POSTFIX_FAILURE_STRING);
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ function isAllowedLocation(node: ts.Node): boolean {
|
||||
// Can be in a comma operator in a for statement (`for (let a = 0, b = 10; a < b; a++, b--)`)
|
||||
case ts.SyntaxKind.BinaryExpression:
|
||||
return (node as ts.BinaryExpression).operatorToken.kind === ts.SyntaxKind.CommaToken &&
|
||||
node.parent!.kind === ts.SyntaxKind.ForStatement;
|
||||
node.parent.kind === ts.SyntaxKind.ForStatement;
|
||||
|
||||
default:
|
||||
return false;
|
||||
|
||||
+16
-3
@@ -2993,7 +2993,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function typeToString(type: Type, enclosingDeclaration?: Node, flags: TypeFormatFlags = TypeFormatFlags.AllowUniqueESSymbolType, writer: EmitTextWriter = createTextWriter("")): string {
|
||||
function typeToString(type: Type, enclosingDeclaration?: Node, flags: TypeFormatFlags = TypeFormatFlags.AllowUniqueESSymbolType | TypeFormatFlags.UseAliasDefinedOutsideCurrentScope, writer: EmitTextWriter = createTextWriter("")): string {
|
||||
const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | NodeBuilderFlags.IgnoreErrors, writer);
|
||||
if (typeNode === undefined) return Debug.fail("should always get typenode");
|
||||
const options = { removeComments: true };
|
||||
@@ -3941,7 +3941,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function typePredicateToString(typePredicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags, writer?: EmitTextWriter): string {
|
||||
function typePredicateToString(typePredicate: TypePredicate, enclosingDeclaration?: Node, flags: TypeFormatFlags = TypeFormatFlags.UseAliasDefinedOutsideCurrentScope, writer?: EmitTextWriter): string {
|
||||
return writer ? typePredicateToStringWorker(writer).getText() : usingSingleLineStringWriter(typePredicateToStringWorker);
|
||||
|
||||
function typePredicateToStringWorker(writer: EmitTextWriter) {
|
||||
@@ -24153,6 +24153,16 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The name cannot be used as 'Object' of user defined types with special target.
|
||||
*/
|
||||
function checkClassNameCollisionWithObject(name: Identifier): void {
|
||||
if (languageVersion === ScriptTarget.ES5 && name.escapedText === "Object"
|
||||
&& moduleKind !== ModuleKind.ES2015 && moduleKind !== ModuleKind.ESNext) {
|
||||
error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check each type parameter and check that type parameters have no duplicate type parameter declarations
|
||||
*/
|
||||
@@ -24279,6 +24289,9 @@ namespace ts {
|
||||
checkTypeNameIsReserved(node.name, Diagnostics.Class_name_cannot_be_0);
|
||||
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
|
||||
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
|
||||
if (!(node.flags & NodeFlags.Ambient)) {
|
||||
checkClassNameCollisionWithObject(node.name);
|
||||
}
|
||||
}
|
||||
checkTypeParameters(getEffectiveTypeParameterDeclarations(node));
|
||||
checkExportsOnMergedDeclarations(node);
|
||||
@@ -24489,7 +24502,7 @@ namespace ts {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isPrototypeProperty(base) && isPrototypeProperty(derived) || base.flags & SymbolFlags.PropertyOrAccessor && derived.flags & SymbolFlags.PropertyOrAccessor) {
|
||||
if (isPrototypeProperty(base) || base.flags & SymbolFlags.PropertyOrAccessor && derived.flags & SymbolFlags.PropertyOrAccessor) {
|
||||
// method is overridden with method or property/accessor is overridden with property/accessor - correct case
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1006,21 +1006,6 @@ namespace ts {
|
||||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a range of value to begin of an array, returning the array.
|
||||
*
|
||||
* @param to The array to which `value` is to be appended. If `to` is `undefined`, a new array
|
||||
* is created if `value` was appended.
|
||||
* @param from The values to append to the array. If `from` is `undefined`, nothing is
|
||||
* appended. If an element of `from` is `undefined`, that element is not appended.
|
||||
*/
|
||||
export function prependRange<T>(to: T[], from: ReadonlyArray<T> | undefined): T[] | undefined {
|
||||
if (from === undefined || from.length === 0) return to;
|
||||
if (to === undefined) return from.slice();
|
||||
to.unshift(...from);
|
||||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Whether the value was added.
|
||||
*/
|
||||
|
||||
@@ -2357,6 +2357,11 @@
|
||||
"category": "Error",
|
||||
"code": 2724
|
||||
},
|
||||
"Class name cannot be 'Object' when targeting ES5 with module {0}.": {
|
||||
"category": "Error",
|
||||
"code": 2725
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 4000
|
||||
|
||||
@@ -6707,7 +6707,7 @@ namespace ts {
|
||||
<JSDocParameterTag>createNode(SyntaxKind.JSDocParameterTag, atToken.pos);
|
||||
let comment: string | undefined;
|
||||
if (indent !== undefined) comment = parseTagComments(indent + scanner.getStartPos() - atToken.pos);
|
||||
const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target);
|
||||
const nestedTypeLiteral = target !== PropertyLikeParse.CallbackParameter && parseNestedTypeLiteral(typeExpression, name, target);
|
||||
if (nestedTypeLiteral) {
|
||||
typeExpression = nestedTypeLiteral;
|
||||
isNameFirst = true;
|
||||
|
||||
@@ -2670,6 +2670,11 @@ namespace ts {
|
||||
return isSameFile(filePath, out) || isSameFile(filePath, removeFileExtension(out) + Extension.Dts);
|
||||
}
|
||||
|
||||
// If declarationDir is specified, return if its a file in that directory
|
||||
if (options.declarationDir && containsPath(options.declarationDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If --outDir, check if file is in that directory
|
||||
if (options.outDir) {
|
||||
return containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames());
|
||||
@@ -2678,8 +2683,8 @@ namespace ts {
|
||||
if (fileExtensionIsOneOf(filePath, supportedJavascriptExtensions) || fileExtensionIs(filePath, Extension.Dts)) {
|
||||
// Otherwise just check if sourceFile with the name exists
|
||||
const filePathWithoutExtension = removeFileExtension(filePath);
|
||||
return !!getSourceFileByPath(combinePaths(filePathWithoutExtension, Extension.Ts) as Path) ||
|
||||
!!getSourceFileByPath(combinePaths(filePathWithoutExtension, Extension.Tsx) as Path);
|
||||
return !!getSourceFileByPath((filePathWithoutExtension + Extension.Ts) as Path) ||
|
||||
!!getSourceFileByPath((filePathWithoutExtension + Extension.Tsx) as Path);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -529,7 +529,7 @@ namespace ts {
|
||||
createVariableStatement(/*modifiers*/ undefined,
|
||||
createVariableDeclarationList(taggedTemplateStringDeclarations)));
|
||||
}
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
exitSubtree(ancestorFacts, HierarchyFacts.None, HierarchyFacts.None);
|
||||
return updateSourceFileNode(
|
||||
node,
|
||||
@@ -837,7 +837,7 @@ namespace ts {
|
||||
setEmitFlags(statement, EmitFlags.NoComments | EmitFlags.NoTokenSourceMaps);
|
||||
statements.push(statement);
|
||||
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
|
||||
const block = createBlock(setTextRange(createNodeArray(statements), /*location*/ node.members), /*multiLine*/ true);
|
||||
setEmitFlags(block, EmitFlags.NoComments);
|
||||
@@ -980,7 +980,7 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
|
||||
if (constructor) {
|
||||
prependCaptureNewTargetIfNeeded(statements, constructor, /*copyOnWrite*/ false);
|
||||
@@ -1896,7 +1896,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
const lexicalEnvironment = context.endLexicalEnvironment();
|
||||
prependRange(statements, lexicalEnvironment);
|
||||
prependStatements(statements, lexicalEnvironment);
|
||||
|
||||
prependCaptureNewTargetIfNeeded(statements, node, /*copyOnWrite*/ false);
|
||||
|
||||
@@ -2712,7 +2712,7 @@ namespace ts {
|
||||
if (loopOutParameters.length) {
|
||||
copyOutParameters(loopOutParameters, CopyDirection.ToOutParameter, statements);
|
||||
}
|
||||
prependRange(statements, lexicalEnvironment);
|
||||
prependStatements(statements, lexicalEnvironment);
|
||||
loopBody = createBlock(statements, /*multiline*/ true);
|
||||
}
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@ namespace ts {
|
||||
)
|
||||
);
|
||||
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
|
||||
const block = createBlock(statements, /*multiLine*/ true);
|
||||
setTextRange(block, node.body);
|
||||
|
||||
@@ -663,7 +663,7 @@ namespace ts {
|
||||
)
|
||||
);
|
||||
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
const block = updateBlock(node.body!, statements);
|
||||
|
||||
// Minor optimization, emit `_super` helper to capture `super` access in an arrow.
|
||||
@@ -695,7 +695,7 @@ namespace ts {
|
||||
const leadingStatements = endLexicalEnvironment();
|
||||
if (statementOffset > 0 || some(statements) || some(leadingStatements)) {
|
||||
const block = convertToFunctionBody(body, /*multiLine*/ true);
|
||||
prependRange(statements, leadingStatements);
|
||||
prependStatements(statements, leadingStatements);
|
||||
addRange(statements, block.statements.slice(statementOffset));
|
||||
return updateBlock(block, setTextRange(createNodeArray(statements), block.statements));
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ namespace ts {
|
||||
transformAndEmitStatements(body.statements, statementOffset);
|
||||
|
||||
const buildResult = build();
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
statements.push(createReturn(buildResult));
|
||||
|
||||
// Restore previous generator state
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace ts {
|
||||
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, isStatement));
|
||||
addRange(statements, visitNodes(node.statements, sourceElementVisitor, isStatement, statementOffset));
|
||||
addExportEqualsIfNeeded(statements, /*emitAsReturn*/ false);
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
|
||||
const updated = updateSourceFileNode(node, setTextRange(createNodeArray(statements), node.statements));
|
||||
if (currentModuleInfo.hasExportStarsToExportValues && !compilerOptions.importHelpers) {
|
||||
@@ -426,7 +426,7 @@ namespace ts {
|
||||
|
||||
// End the lexical environment for the module body
|
||||
// and merge any new lexical declarations.
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
|
||||
const body = createBlock(statements, /*multiLine*/ true);
|
||||
if (currentModuleInfo.hasExportStarsToExportValues && !compilerOptions.importHelpers) {
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace ts {
|
||||
// We emit hoisted variables early to align roughly with our previous emit output.
|
||||
// Two key differences in this approach are:
|
||||
// - Temporary variables will appear at the top rather than at the bottom of the file
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
|
||||
const exportStarFunction = addExportStarIfNeeded(statements)!; // TODO: GH#18217
|
||||
const moduleObject = createObjectLiteral([
|
||||
|
||||
@@ -669,7 +669,7 @@ namespace ts {
|
||||
setEmitFlags(statement, EmitFlags.NoComments | EmitFlags.NoTokenSourceMaps);
|
||||
statements.push(statement);
|
||||
|
||||
prependRange(statements, context.endLexicalEnvironment());
|
||||
prependStatements(statements, context.endLexicalEnvironment());
|
||||
|
||||
const iife = createImmediatelyInvokedArrowFunction(statements);
|
||||
setEmitFlags(iife, EmitFlags.TypeScriptClassWrapper);
|
||||
@@ -2693,7 +2693,7 @@ namespace ts {
|
||||
const statements: Statement[] = [];
|
||||
startLexicalEnvironment();
|
||||
const members = map(node.members, transformEnumMember);
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
addRange(statements, members);
|
||||
|
||||
currentNamespaceContainerName = savedCurrentNamespaceLocalName;
|
||||
@@ -3008,7 +3008,7 @@ namespace ts {
|
||||
statementsLocation = moveRangePos(moduleBlock.statements, -1);
|
||||
}
|
||||
|
||||
prependRange(statements, endLexicalEnvironment());
|
||||
prependStatements(statements, endLexicalEnvironment());
|
||||
currentNamespaceContainerName = savedCurrentNamespaceContainerName;
|
||||
currentNamespace = savedCurrentNamespace;
|
||||
currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
|
||||
|
||||
@@ -254,6 +254,25 @@ namespace ts {
|
||||
return !nodeIsMissing(node);
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a range of value to begin of an array, returning the array.
|
||||
*
|
||||
* @param to The array to which `value` is to be appended. If `to` is `undefined`, a new array
|
||||
* is created if `value` was appended.
|
||||
* @param from The values to append to the array. If `from` is `undefined`, nothing is
|
||||
* appended. If an element of `from` is `undefined`, that element is not appended.
|
||||
*/
|
||||
export function prependStatements<T extends Statement>(to: T[], from: ReadonlyArray<T> | undefined): T[] | undefined {
|
||||
if (from === undefined || from.length === 0) return to;
|
||||
if (to === undefined) return from.slice();
|
||||
const prologue = to.length && isPrologueDirective(to[0]) && to.shift();
|
||||
to.unshift(...from);
|
||||
if (prologue) {
|
||||
to.unshift(prologue);
|
||||
}
|
||||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given comment is a triple-slash
|
||||
*
|
||||
|
||||
@@ -1469,7 +1469,7 @@ namespace ts {
|
||||
|
||||
return isNodeArray(statements)
|
||||
? setTextRange(createNodeArray(concatenate(declarations, statements)), statements)
|
||||
: prependRange(statements, declarations);
|
||||
: prependStatements(statements, declarations);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,13 @@ namespace Harness.Parallel.Host {
|
||||
on(event: "message", listener: (message: ParallelClientMessage) => void): this;
|
||||
kill(signal?: string): void;
|
||||
currentTasks?: {file: string}[]; // Custom monkeypatch onto child process handle
|
||||
accumulatedOutput: string; // Custom monkeypatch with process output
|
||||
stderr: PartialStream;
|
||||
stdout: PartialStream;
|
||||
}
|
||||
|
||||
interface PartialStream {
|
||||
on(event: "data", listener: (chunk: Buffer) => void): this;
|
||||
}
|
||||
|
||||
interface ProgressBarsOptions {
|
||||
@@ -151,7 +158,13 @@ namespace Harness.Parallel.Host {
|
||||
const config: TestConfig = { light: lightMode, listenForWork: true, runUnitTests, stackTraceLimit };
|
||||
const configPath = ts.combinePaths(taskConfigsFolder, `task-config${i}.json`);
|
||||
IO.writeFile(configPath, JSON.stringify(config));
|
||||
const child = fork(__filename, [`--config="${configPath}"`]);
|
||||
const child = fork(__filename, [`--config="${configPath}"`], { stdio: ["pipe", "pipe", "pipe", "ipc"] });
|
||||
child.accumulatedOutput = "";
|
||||
const appendOutput = (d: Buffer) => {
|
||||
child.accumulatedOutput += d.toString();
|
||||
};
|
||||
child.stderr.on("data", appendOutput);
|
||||
child.stdout.on("data", appendOutput);
|
||||
let currentTimeout = defaultTimeout;
|
||||
const killChild = () => {
|
||||
child.kill();
|
||||
@@ -166,8 +179,10 @@ namespace Harness.Parallel.Host {
|
||||
return process.exit(2);
|
||||
});
|
||||
child.on("exit", (code, _signal) => {
|
||||
clearTimeout(timer);
|
||||
if (code !== 0) {
|
||||
console.error("Test worker process exited with nonzero exit code!");
|
||||
console.error(`Test worker process exited with nonzero exit code! Output:
|
||||
${child.accumulatedOutput}`);
|
||||
return process.exit(2);
|
||||
}
|
||||
});
|
||||
@@ -223,6 +238,7 @@ namespace Harness.Parallel.Host {
|
||||
// No more tasks to distribute
|
||||
child.send({ type: "close" });
|
||||
closedWorkers++;
|
||||
clearTimeout(timer);
|
||||
if (closedWorkers === workerCount) {
|
||||
outputFinalResult();
|
||||
}
|
||||
|
||||
@@ -1116,34 +1116,53 @@ namespace ts.tscWatch {
|
||||
assert.equal(nowErrors[1].start, intialErrors[1].start! - configFileContentComment.length);
|
||||
});
|
||||
|
||||
it("should not trigger recompilation because of program emit", () => {
|
||||
const proj = "/user/username/projects/myproject";
|
||||
const file1: File = {
|
||||
path: `${proj}/file1.ts`,
|
||||
content: "export const c = 30;"
|
||||
};
|
||||
const file2: File = {
|
||||
path: `${proj}/src/file2.ts`,
|
||||
content: `import {c} from "file1"; export const d = 30;`
|
||||
};
|
||||
const tsconfig: File = {
|
||||
path: `${proj}/tsconfig.json`,
|
||||
content: JSON.stringify({
|
||||
compilerOptions: {
|
||||
module: "amd",
|
||||
outDir: "build"
|
||||
}
|
||||
})
|
||||
};
|
||||
const host = createWatchedSystem([file1, file2, libFile, tsconfig], { currentDirectory: proj });
|
||||
const watch = createWatchOfConfigFile(tsconfig.path, host, /*maxNumberOfFilesToIterateForInvalidation*/1);
|
||||
checkProgramActualFiles(watch(), [file1.path, file2.path, libFile.path]);
|
||||
describe("should not trigger should not trigger recompilation because of program emit", () => {
|
||||
function verifyWithOptions(options: CompilerOptions, outputFiles: ReadonlyArray<string>) {
|
||||
const proj = "/user/username/projects/myproject";
|
||||
const file1: File = {
|
||||
path: `${proj}/file1.ts`,
|
||||
content: "export const c = 30;"
|
||||
};
|
||||
const file2: File = {
|
||||
path: `${proj}/src/file2.ts`,
|
||||
content: `import {c} from "file1"; export const d = 30;`
|
||||
};
|
||||
const tsconfig: File = {
|
||||
path: `${proj}/tsconfig.json`,
|
||||
content: generateTSConfig(options, emptyArray, "\n")
|
||||
};
|
||||
const host = createWatchedSystem([file1, file2, libFile, tsconfig], { currentDirectory: proj });
|
||||
const watch = createWatchOfConfigFile(tsconfig.path, host, /*maxNumberOfFilesToIterateForInvalidation*/1);
|
||||
checkProgramActualFiles(watch(), [file1.path, file2.path, libFile.path]);
|
||||
|
||||
assert.isTrue(host.fileExists("build/file1.js"));
|
||||
assert.isTrue(host.fileExists("build/src/file2.js"));
|
||||
outputFiles.forEach(f => host.fileExists(f));
|
||||
|
||||
// This should be 0
|
||||
host.checkTimeoutQueueLengthAndRun(0);
|
||||
// This should be 0
|
||||
host.checkTimeoutQueueLengthAndRun(0);
|
||||
}
|
||||
|
||||
it("without outDir or outFile is specified", () => {
|
||||
debugger;
|
||||
verifyWithOptions({ module: ModuleKind.AMD }, ["file1.js", "src/file2.js"]);
|
||||
});
|
||||
|
||||
it("with outFile", () => {
|
||||
verifyWithOptions({ module: ModuleKind.AMD, outFile: "build/outFile.js" }, ["build/outFile.js"]);
|
||||
});
|
||||
|
||||
it("when outDir is specified", () => {
|
||||
verifyWithOptions({ module: ModuleKind.AMD, outDir: "build" }, ["build/file1.js", "build/src/file2.js"]);
|
||||
});
|
||||
|
||||
it("when outDir and declarationDir is specified", () => {
|
||||
verifyWithOptions({ module: ModuleKind.AMD, outDir: "build", declaration: true, declarationDir: "decls" },
|
||||
["build/file1.js", "build/src/file2.js", "decls/file1.d.ts", "decls/src/file2.d.ts"]);
|
||||
});
|
||||
|
||||
it("declarationDir is specified", () => {
|
||||
verifyWithOptions({ module: ModuleKind.AMD, declaration: true, declarationDir: "decls" },
|
||||
["file1.js", "src/file2.js", "decls/file1.d.ts", "decls/src/file2.d.ts"]);
|
||||
});
|
||||
});
|
||||
|
||||
it("shouldnt report error about unused function incorrectly when file changes from global to module", () => {
|
||||
|
||||
@@ -8314,7 +8314,7 @@ new C();`
|
||||
});
|
||||
});
|
||||
|
||||
describe("watchDirectories implementation", () => {
|
||||
describe("tsserverProjectSystem watchDirectories implementation", () => {
|
||||
function verifyCompletionListWithNewFileInSubFolder(tscWatchDirectory: TestFSWithWatch.Tsc_WatchDirectory) {
|
||||
const projectFolder = "/a/username/project";
|
||||
const projectSrcFolder = `${projectFolder}/src`;
|
||||
@@ -8422,7 +8422,7 @@ new C();`
|
||||
});
|
||||
});
|
||||
|
||||
describe("document registry in project service", () => {
|
||||
describe("tsserverProjectSystem document registry in project service", () => {
|
||||
const projectRootPath = "/user/username/projects/project";
|
||||
const importModuleContent = `import {a} from "./module1"`;
|
||||
const file: File = {
|
||||
|
||||
@@ -1008,6 +1008,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_missing_typeof_95052" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add missing 'typeof']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[添加缺少的 "typeof"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add qualifier to all unresolved variables matching a member name]]></Val>
|
||||
@@ -1125,6 +1134,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";All_variables_are_unused_6199" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[All variables are unused.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[所有变量均未使用。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Allow default imports from modules with no default export. This does not affect code emit, just typechecking.]]></Val>
|
||||
@@ -2376,6 +2394,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[使用模块 {0} 将目标设置为 ES5 时,类名称不能为 "Object"。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
|
||||
@@ -2538,6 +2565,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[将“{0}”转换为映射对象类型]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
|
||||
@@ -6564,6 +6600,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_all_unused_labels_95054" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove all unused labels]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[删除所有未使用的标签]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
|
||||
@@ -6603,6 +6648,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_unused_label_95053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused label]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[删除未使用的标签]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_variable_statement_90010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove variable statement]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[删除变量语句]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_import_with_0_95015" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace import with '{0}'.]]></Val>
|
||||
|
||||
@@ -2394,6 +2394,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[當目標為具有模組 {0} 的 ES5 時,類別名稱不可為 'Object'。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
|
||||
@@ -2556,6 +2565,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[將 '{0}' 轉換為對應的物件類型]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
|
||||
|
||||
@@ -1017,6 +1017,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_missing_typeof_95052" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add missing 'typeof']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Přidat chybějící typeof]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add qualifier to all unresolved variables matching a member name]]></Val>
|
||||
@@ -1134,6 +1143,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";All_variables_are_unused_6199" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[All variables are unused.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Žádná z proměnných se nepoužívá.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Allow default imports from modules with no default export. This does not affect code emit, just typechecking.]]></Val>
|
||||
@@ -2385,6 +2403,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Když se cílí na ES5 s modulem {0}, název třídy nemůže být Object.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
|
||||
@@ -2547,6 +2574,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Převést {0} na typ mapovaného objektu]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
|
||||
@@ -6573,6 +6609,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_all_unused_labels_95054" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove all unused labels]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Odebrat všechny nepoužívané popisky]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
|
||||
@@ -6612,6 +6657,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_unused_label_95053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused label]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Odebrat nepoužitý popisek]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_variable_statement_90010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove variable statement]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Odebrat příkaz proměnné]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_import_with_0_95015" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace import with '{0}'.]]></Val>
|
||||
|
||||
@@ -1005,6 +1005,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_missing_typeof_95052" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add missing 'typeof']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Fehlenden "typeof" hinzufügen]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add qualifier to all unresolved variables matching a member name]]></Val>
|
||||
@@ -1122,6 +1131,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";All_variables_are_unused_6199" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[All variables are unused.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Alle Variablen werden nicht verwendet.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Allow default imports from modules with no default export. This does not affect code emit, just typechecking.]]></Val>
|
||||
@@ -2373,6 +2391,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Klassenname darf nicht "Object" lauten, wenn ES5 mit Modul "{0}" als Ziel verwendet wird.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
|
||||
@@ -2535,6 +2562,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA["{0}" in zugeordneten Objekttyp konvertieren]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
|
||||
@@ -6558,6 +6594,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_all_unused_labels_95054" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove all unused labels]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Alle nicht verwendeten Bezeichnungen entfernen]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
|
||||
@@ -6597,6 +6642,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_unused_label_95053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused label]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nicht verwendete Bezeichnung entfernen]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_variable_statement_90010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove variable statement]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Variablenanweisung entfernen]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_import_with_0_95015" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace import with '{0}'.]]></Val>
|
||||
|
||||
@@ -1019,10 +1019,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Add_missing_typeof_95052" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add missing typeof]]></Val>
|
||||
<Val><![CDATA[Add missing 'typeof']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Agregar el objeto typeof que falta]]></Val>
|
||||
<Val><![CDATA[Agregar el elemento "typeof" que falta]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Add missing typeof]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -1143,6 +1146,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";All_variables_are_unused_6199" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[All variables are unused.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Todas las variables son no utilizadas.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Allow default imports from modules with no default export. This does not affect code emit, just typechecking.]]></Val>
|
||||
@@ -2556,6 +2568,12 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
|
||||
@@ -6585,6 +6603,9 @@
|
||||
<Item ItemId=";Remove_all_unused_labels_95054" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove all unused labels]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Quitar todas las etiquetas no utilizadas]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -6630,6 +6651,18 @@
|
||||
<Item ItemId=";Remove_unused_label_95053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused label]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Quitar etiqueta no utilizada]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_variable_statement_90010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove variable statement]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Quitar la declaración de variable]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -1008,6 +1008,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_missing_typeof_95052" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add missing 'typeof']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Aggiungere l'elemento 'typeof' mancante]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add qualifier to all unresolved variables matching a member name]]></Val>
|
||||
@@ -1125,6 +1134,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";All_variables_are_unused_6199" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[All variables are unused.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Tutte le variabili sono inutilizzate.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Allow default imports from modules with no default export. This does not affect code emit, just typechecking.]]></Val>
|
||||
@@ -2376,6 +2394,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il nome della classe non può essere 'Object' quando la destinazione è ES5 con il modulo {0}.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
|
||||
@@ -2538,6 +2565,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Convertire '{0}' nel tipo di oggetto con mapping]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
|
||||
@@ -6564,6 +6600,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_all_unused_labels_95054" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove all unused labels]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Rimuovere tutte le etichette inutilizzate]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
|
||||
@@ -6603,6 +6648,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_unused_label_95053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused label]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Rimuovere l'etichetta inutilizzata]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_variable_statement_90010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove variable statement]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Rimuovere l'istruzione di variabile]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_import_with_0_95015" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace import with '{0}'.]]></Val>
|
||||
|
||||
@@ -1008,6 +1008,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_missing_typeof_95052" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add missing 'typeof']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[不足している 'typeof' を追加します]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add qualifier to all unresolved variables matching a member name]]></Val>
|
||||
@@ -1125,6 +1134,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";All_variables_are_unused_6199" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[All variables are unused.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[すべての変数は未使用です。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Allow default imports from modules with no default export. This does not affect code emit, just typechecking.]]></Val>
|
||||
@@ -2538,6 +2556,12 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
|
||||
@@ -6564,6 +6588,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_all_unused_labels_95054" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove all unused labels]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[すべての未使用のラベルを削除します]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
|
||||
@@ -6603,6 +6636,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_unused_label_95053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused label]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[未使用のラベルを削除します]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_variable_statement_90010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove variable statement]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[変数のステートメントを削除します]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_import_with_0_95015" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace import with '{0}'.]]></Val>
|
||||
|
||||
@@ -1008,6 +1008,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_missing_typeof_95052" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add missing 'typeof']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[누락된 'typeof' 추가]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add qualifier to all unresolved variables matching a member name]]></Val>
|
||||
@@ -1125,6 +1134,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";All_variables_are_unused_6199" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[All variables are unused.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[모든 변수가 사용되지 않습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Allow default imports from modules with no default export. This does not affect code emit, just typechecking.]]></Val>
|
||||
@@ -2376,6 +2394,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[{0} 모듈을 사용하는 ES5를 대상으로 하는 경우 클래스 이름은 'Object'일 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
|
||||
@@ -2538,6 +2565,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}'을(를) 매핑된 개체 형식으로 변환]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
|
||||
@@ -6564,6 +6600,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_all_unused_labels_95054" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove all unused labels]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[사용되지 않는 레이블 모두 제거]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
|
||||
@@ -6603,6 +6648,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_unused_label_95053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused label]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[사용되지 않는 레이블 제거]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Remove_variable_statement_90010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove variable statement]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[변수 문 제거]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_import_with_0_95015" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace import with '{0}'.]]></Val>
|
||||
|
||||
@@ -2384,6 +2384,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nazwą klasy nie może być słowo „Object”, gdy docelowym językiem jest ES5 z modułem {0}.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
|
||||
@@ -2549,6 +2558,9 @@
|
||||
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Konwertuj element „{0}” na zamapowany typ obiektu]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -2393,6 +2393,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be 'Object' when targeting ES5 with module {0}.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Класс не может иметь имя "Object" при выборе ES5 с модулем {0} в качестве целевого.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class static side '{0}' incorrectly extends base class static side '{1}'.]]></Val>
|
||||
@@ -2555,6 +2564,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_0_to_mapped_object_type_95055" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to mapped object type]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Преобразовать "{0}" в тип сопоставленного объекта]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
namespace ts.server.typingsInstaller {
|
||||
const fs: {
|
||||
appendFileSync(file: string, content: string): void;
|
||||
existsSync(path: string): boolean;
|
||||
appendFileSync(file: string, content: string): void
|
||||
} = require("fs");
|
||||
|
||||
const path: {
|
||||
@@ -33,12 +32,11 @@ namespace ts.server.typingsInstaller {
|
||||
/** Used if `--npmLocation` is not passed. */
|
||||
function getDefaultNPMLocation(processName: string) {
|
||||
if (path.basename(processName).indexOf("node") === 0) {
|
||||
const npmPath = `"${path.join(path.dirname(process.argv[0]), "npm")}"`;
|
||||
if (fs.existsSync(npmPath)) {
|
||||
return npmPath;
|
||||
}
|
||||
return `"${path.join(path.dirname(process.argv[0]), "npm")}"`;
|
||||
}
|
||||
else {
|
||||
return "npm";
|
||||
}
|
||||
return "npm";
|
||||
}
|
||||
|
||||
interface TypesRegistryFile {
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace ts.codefix {
|
||||
registerCodeFix({
|
||||
errorCodes,
|
||||
getCodeActions(context) {
|
||||
const { errorCode, sourceFile } = context;
|
||||
const { errorCode, sourceFile, program } = context;
|
||||
const checker = program.getTypeChecker();
|
||||
const startToken = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false);
|
||||
|
||||
const importDecl = tryGetFullImport(startToken);
|
||||
@@ -22,7 +23,7 @@ namespace ts.codefix {
|
||||
const changes = textChanges.ChangeTracker.with(context, t => t.deleteNode(sourceFile, importDecl));
|
||||
return [createCodeFixAction(fixName, changes, [Diagnostics.Remove_import_from_0, showModuleSpecifier(importDecl)], fixIdDelete, Diagnostics.Delete_all_unused_declarations)];
|
||||
}
|
||||
const delDestructure = textChanges.ChangeTracker.with(context, t => tryDeleteFullDestructure(t, sourceFile, startToken, /*deleted*/ undefined));
|
||||
const delDestructure = textChanges.ChangeTracker.with(context, t => tryDeleteFullDestructure(t, sourceFile, startToken, /*deleted*/ undefined, checker, /*isFixAll*/ false));
|
||||
if (delDestructure.length) {
|
||||
return [createCodeFixAction(fixName, delDestructure, Diagnostics.Remove_destructuring, fixIdDelete, Diagnostics.Delete_all_unused_declarations)];
|
||||
}
|
||||
@@ -34,7 +35,7 @@ namespace ts.codefix {
|
||||
const token = getToken(sourceFile, textSpanEnd(context.span));
|
||||
const result: CodeFixAction[] = [];
|
||||
|
||||
const deletion = textChanges.ChangeTracker.with(context, t => tryDeleteDeclaration(t, sourceFile, token, /*deleted*/ undefined));
|
||||
const deletion = textChanges.ChangeTracker.with(context, t => tryDeleteDeclaration(t, sourceFile, token, /*deleted*/ undefined, checker, /*isFixAll*/ false));
|
||||
if (deletion.length) {
|
||||
result.push(createCodeFixAction(fixName, deletion, [Diagnostics.Remove_declaration_for_Colon_0, token.getText(sourceFile)], fixIdDelete, Diagnostics.Delete_all_unused_declarations));
|
||||
}
|
||||
@@ -50,8 +51,9 @@ namespace ts.codefix {
|
||||
getAllCodeActions: context => {
|
||||
// Track a set of deleted nodes that may be ancestors of other marked for deletion -- only delete the ancestors.
|
||||
const deleted = new NodeSet();
|
||||
const { sourceFile, program } = context;
|
||||
const checker = program.getTypeChecker();
|
||||
return codeFixAll(context, errorCodes, (changes, diag) => {
|
||||
const { sourceFile } = context;
|
||||
const startToken = getTokenAtPosition(sourceFile, diag.start, /*includeJsDocComment*/ false);
|
||||
const token = findPrecedingToken(textSpanEnd(diag), diag.file)!;
|
||||
switch (context.fixId) {
|
||||
@@ -68,8 +70,9 @@ namespace ts.codefix {
|
||||
if (importDecl) {
|
||||
changes.deleteNode(sourceFile, importDecl);
|
||||
}
|
||||
else if (!tryDeleteFullDestructure(changes, sourceFile, startToken, deleted) && !tryDeleteFullVariableStatement(changes, sourceFile, startToken, deleted)) {
|
||||
tryDeleteDeclaration(changes, sourceFile, token, deleted);
|
||||
else if (!tryDeleteFullDestructure(changes, sourceFile, startToken, deleted, checker, /*isFixAll*/ true) &&
|
||||
!tryDeleteFullVariableStatement(changes, sourceFile, startToken, deleted)) {
|
||||
tryDeleteDeclaration(changes, sourceFile, token, deleted, checker, /*isFixAll*/ true);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -84,7 +87,7 @@ namespace ts.codefix {
|
||||
return startToken.kind === SyntaxKind.ImportKeyword ? tryCast(startToken.parent, isImportDeclaration) : undefined;
|
||||
}
|
||||
|
||||
function tryDeleteFullDestructure(changes: textChanges.ChangeTracker, sourceFile: SourceFile, startToken: Node, deletedAncestors: NodeSet | undefined): boolean {
|
||||
function tryDeleteFullDestructure(changes: textChanges.ChangeTracker, sourceFile: SourceFile, startToken: Node, deletedAncestors: NodeSet | undefined, checker: TypeChecker, isFixAll: boolean): boolean {
|
||||
if (startToken.kind !== SyntaxKind.OpenBraceToken || !isObjectBindingPattern(startToken.parent)) return false;
|
||||
const decl = cast(startToken.parent, isObjectBindingPattern).parent;
|
||||
switch (decl.kind) {
|
||||
@@ -92,6 +95,7 @@ namespace ts.codefix {
|
||||
tryDeleteVariableDeclaration(changes, sourceFile, decl, deletedAncestors);
|
||||
break;
|
||||
case SyntaxKind.Parameter:
|
||||
if (!mayDeleteParameter(decl, checker, isFixAll)) break;
|
||||
if (deletedAncestors) deletedAncestors.add(decl);
|
||||
changes.deleteNodeInList(sourceFile, decl);
|
||||
break;
|
||||
@@ -144,10 +148,10 @@ namespace ts.codefix {
|
||||
return false;
|
||||
}
|
||||
|
||||
function tryDeleteDeclaration(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Node, deletedAncestors: NodeSet | undefined): void {
|
||||
function tryDeleteDeclaration(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Node, deletedAncestors: NodeSet | undefined, checker: TypeChecker, isFixAll: boolean): void {
|
||||
switch (token.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
tryDeleteIdentifier(changes, sourceFile, <Identifier>token, deletedAncestors);
|
||||
tryDeleteIdentifier(changes, sourceFile, <Identifier>token, deletedAncestors, checker, isFixAll);
|
||||
break;
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
case SyntaxKind.NamespaceImport:
|
||||
@@ -170,7 +174,7 @@ namespace ts.codefix {
|
||||
}
|
||||
}
|
||||
|
||||
function tryDeleteIdentifier(changes: textChanges.ChangeTracker, sourceFile: SourceFile, identifier: Identifier, deletedAncestors: NodeSet | undefined): void {
|
||||
function tryDeleteIdentifier(changes: textChanges.ChangeTracker, sourceFile: SourceFile, identifier: Identifier, deletedAncestors: NodeSet | undefined, checker: TypeChecker, isFixAll: boolean): void {
|
||||
const parent = identifier.parent;
|
||||
switch (parent.kind) {
|
||||
case SyntaxKind.VariableDeclaration:
|
||||
@@ -194,11 +198,8 @@ namespace ts.codefix {
|
||||
break;
|
||||
|
||||
case SyntaxKind.Parameter:
|
||||
if (!mayDeleteParameter(parent as ParameterDeclaration, checker, isFixAll)) break;
|
||||
const oldFunction = parent.parent;
|
||||
if (isSetAccessor(oldFunction)) {
|
||||
// Setter must have a parameter
|
||||
break;
|
||||
}
|
||||
|
||||
if (isArrowFunction(oldFunction) && oldFunction.parameters.length === 1) {
|
||||
// Lambdas with exactly one parameter are special because, after removal, there
|
||||
@@ -347,4 +348,35 @@ namespace ts.codefix {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function mayDeleteParameter(p: ParameterDeclaration, checker: TypeChecker, isFixAll: boolean) {
|
||||
const parent = p.parent;
|
||||
switch (parent.kind) {
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
// Don't remove a parameter if this overrides something
|
||||
const symbol = checker.getSymbolAtLocation(parent.name)!;
|
||||
if (isMemberSymbolInBaseType(symbol, checker)) return false;
|
||||
// falls through
|
||||
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.FunctionExpression:
|
||||
case SyntaxKind.ArrowFunction: {
|
||||
// Can't remove a non-last parameter. Can remove a parameter in code-fix-all if future parameters are also unused.
|
||||
const { parameters } = parent;
|
||||
const index = parameters.indexOf(p);
|
||||
Debug.assert(index !== -1);
|
||||
return isFixAll
|
||||
? parameters.slice(index + 1).every(p => p.name.kind === SyntaxKind.Identifier && !p.symbol.isReferenced)
|
||||
: index === parameters.length - 1;
|
||||
}
|
||||
|
||||
case SyntaxKind.SetAccessor:
|
||||
// Setter must have a parameter
|
||||
return false;
|
||||
|
||||
default:
|
||||
return Debug.failBadSyntaxKind(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,15 +16,18 @@ namespace ts.moduleSpecifiers {
|
||||
const getCanonicalFileName = hostGetCanonicalFileName(host);
|
||||
const sourceDirectory = getDirectoryPath(importingSourceFile.fileName);
|
||||
|
||||
return getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(moduleFileName => {
|
||||
const global = tryGetModuleNameFromAmbientModule(moduleSymbol)
|
||||
|| tryGetModuleNameFromTypeRoots(compilerOptions, host, getCanonicalFileName, moduleFileName, addJsExtension)
|
||||
|| tryGetModuleNameAsNodeModule(compilerOptions, moduleFileName, host, getCanonicalFileName, sourceDirectory)
|
||||
|| rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName);
|
||||
if (global) {
|
||||
return [global];
|
||||
}
|
||||
const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol);
|
||||
if (ambient) return [[ambient]];
|
||||
|
||||
const modulePaths = getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile());
|
||||
|
||||
const global = mapDefined(modulePaths, moduleFileName =>
|
||||
tryGetModuleNameFromTypeRoots(compilerOptions, host, getCanonicalFileName, moduleFileName, addJsExtension) ||
|
||||
tryGetModuleNameAsNodeModule(compilerOptions, moduleFileName, host, getCanonicalFileName, sourceDirectory) ||
|
||||
rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName));
|
||||
if (global.length) return global.map(g => [g]);
|
||||
|
||||
return modulePaths.map(moduleFileName => {
|
||||
const relativePath = removeExtensionAndIndexPostFix(ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), moduleResolutionKind, addJsExtension);
|
||||
if (!baseUrl || preferences.importModuleSpecifierPreference === "relative") {
|
||||
return [relativePath];
|
||||
@@ -191,11 +194,12 @@ namespace ts.moduleSpecifiers {
|
||||
// Simplify the full file path to something that can be resolved by Node.
|
||||
|
||||
// If the module could be imported by a directory name, use that directory's name
|
||||
let moduleSpecifier = getDirectoryOrExtensionlessFileName(moduleFileName);
|
||||
const moduleSpecifier = getDirectoryOrExtensionlessFileName(moduleFileName);
|
||||
// Get a path that's relative to node_modules or the importing file's path
|
||||
moduleSpecifier = getNodeResolvablePath(moduleSpecifier);
|
||||
// if node_modules folder is in this folder or any of its parent folders, no need to keep it.
|
||||
if (!startsWith(sourceDirectory, moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex))) return undefined;
|
||||
// If the module was found in @types, get the actual Node package name
|
||||
return getPackageNameFromAtTypesDirectory(moduleSpecifier);
|
||||
return getPackageNameFromAtTypesDirectory(moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1));
|
||||
|
||||
function getDirectoryOrExtensionlessFileName(path: string): string {
|
||||
// If the file is the main module, it can be imported by the package name
|
||||
@@ -224,17 +228,6 @@ namespace ts.moduleSpecifiers {
|
||||
|
||||
return fullModulePathWithoutExtension;
|
||||
}
|
||||
|
||||
function getNodeResolvablePath(path: string): string {
|
||||
const basePath = path.substring(0, parts.topLevelNodeModulesIndex);
|
||||
if (sourceDirectory.indexOf(basePath) === 0) {
|
||||
// if node_modules folder is in this folder or any of its parent folders, no need to keep it.
|
||||
return path.substring(parts.topLevelPackageNameIndex + 1);
|
||||
}
|
||||
else {
|
||||
return ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, path, getCanonicalFileName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface NodeModulePathParts {
|
||||
|
||||
@@ -895,6 +895,7 @@ namespace ts.Completions {
|
||||
node = (parent as QualifiedName).left;
|
||||
break;
|
||||
case SyntaxKind.ImportType:
|
||||
case SyntaxKind.MetaProperty:
|
||||
node = parent;
|
||||
break;
|
||||
default:
|
||||
@@ -1061,6 +1062,12 @@ namespace ts.Completions {
|
||||
}
|
||||
}
|
||||
|
||||
if (isMetaProperty(node) && (node.keywordToken === SyntaxKind.NewKeyword || node.keywordToken === SyntaxKind.ImportKeyword)) {
|
||||
const completion = (node.keywordToken === SyntaxKind.NewKeyword) ? "target" : "meta";
|
||||
symbols.push(typeChecker.createSymbol(SymbolFlags.Property, escapeLeadingUnderscores(completion)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isTypeLocation) {
|
||||
addTypeProperties(typeChecker.getTypeAtLocation(node)!);
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace ts.DocumentHighlights {
|
||||
default:
|
||||
// Don't cross function boundaries.
|
||||
// TODO: GH#20090
|
||||
return (isFunctionLike(node) && "quit") as false | "quit";
|
||||
return isFunctionLike(node) && "quit";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1399,34 +1399,6 @@ namespace ts.FindAllReferences.Core {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find symbol of the given property-name and add the symbol to the given result array
|
||||
* @param symbol a symbol to start searching for the given propertyName
|
||||
* @param propertyName a name of property to search for
|
||||
* @param result an array of symbol of found property symbols
|
||||
* @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol.
|
||||
* The value of previousIterationSymbol is undefined when the function is first called.
|
||||
*/
|
||||
function getPropertySymbolsFromBaseTypes<T>(symbol: Symbol, propertyName: string, checker: TypeChecker, cb: (symbol: Symbol) => T | undefined): T | undefined {
|
||||
const seen = createMap<true>();
|
||||
return recur(symbol);
|
||||
|
||||
function recur(symbol: Symbol): T | undefined {
|
||||
// Use `addToSeen` to ensure we don't infinitely recurse in this situation:
|
||||
// interface C extends C {
|
||||
// /*findRef*/propName: string;
|
||||
// }
|
||||
if (!(symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) || !addToSeen(seen, getSymbolId(symbol))) return;
|
||||
|
||||
return firstDefined(symbol.declarations, declaration => firstDefined(getAllSuperTypeNodes(declaration), typeReference => {
|
||||
const type = checker.getTypeAtLocation(typeReference);
|
||||
const propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);
|
||||
// Visit the typeReference as well to see if it directly or indirectly uses that property
|
||||
return propertySymbol && (firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type!.symbol));
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
function getRelatedSymbol(search: Search, referenceSymbol: Symbol, referenceLocation: Node, state: State): Symbol | undefined {
|
||||
const { checker } = state;
|
||||
return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker,
|
||||
|
||||
+11
-16
@@ -243,7 +243,7 @@ namespace ts.JsDoc {
|
||||
}
|
||||
|
||||
const tokenAtPos = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false);
|
||||
const tokenStart = tokenAtPos.getStart();
|
||||
const tokenStart = tokenAtPos.getStart(sourceFile);
|
||||
if (!tokenAtPos || tokenStart < position) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ namespace ts.JsDoc {
|
||||
return undefined;
|
||||
}
|
||||
const { commentOwner, parameters } = commentOwnerInfo;
|
||||
if (commentOwner.getStart() < position) {
|
||||
if (commentOwner.getStart(sourceFile) < position) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -268,19 +268,6 @@ namespace ts.JsDoc {
|
||||
|
||||
// replace non-whitespace characters in prefix with spaces.
|
||||
const indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, () => " ");
|
||||
const isJavaScriptFile = hasJavaScriptFileExtension(sourceFile.fileName);
|
||||
|
||||
let docParams = "";
|
||||
for (let i = 0; i < parameters.length; i++) {
|
||||
const currentName = parameters[i].name;
|
||||
const paramName = currentName.kind === SyntaxKind.Identifier ? currentName.escapedText : "param" + i;
|
||||
if (isJavaScriptFile) {
|
||||
docParams += `${indentationStr} * @param {any} ${paramName}${newLine}`;
|
||||
}
|
||||
else {
|
||||
docParams += `${indentationStr} * @param ${paramName}${newLine}`;
|
||||
}
|
||||
}
|
||||
|
||||
// A doc comment consists of the following
|
||||
// * The opening comment line
|
||||
@@ -293,13 +280,21 @@ namespace ts.JsDoc {
|
||||
indentationStr + " * ";
|
||||
const result =
|
||||
preamble + newLine +
|
||||
docParams +
|
||||
parameterDocComments(parameters, hasJavaScriptFileExtension(sourceFile.fileName), indentationStr, newLine) +
|
||||
indentationStr + " */" +
|
||||
(tokenStart === position ? newLine + indentationStr : "");
|
||||
|
||||
return { newText: result, caretOffset: preamble.length };
|
||||
}
|
||||
|
||||
function parameterDocComments(parameters: ReadonlyArray<ParameterDeclaration>, isJavaScriptFile: boolean, indentationStr: string, newLine: string): string {
|
||||
return parameters.map(({ name, dotDotDotToken }, i) => {
|
||||
const paramName = name.kind === SyntaxKind.Identifier ? name.text : "param" + i;
|
||||
const type = isJavaScriptFile ? (dotDotDotToken ? "{...any} " : "{any} ") : "";
|
||||
return `${indentationStr} * @param ${type}${paramName}${newLine}`;
|
||||
}).join("");
|
||||
}
|
||||
|
||||
interface CommentOwnerInfo {
|
||||
readonly commentOwner: Node;
|
||||
readonly parameters?: ReadonlyArray<ParameterDeclaration>;
|
||||
|
||||
@@ -1293,6 +1293,38 @@ namespace ts {
|
||||
return propSymbol;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find symbol of the given property-name and add the symbol to the given result array
|
||||
* @param symbol a symbol to start searching for the given propertyName
|
||||
* @param propertyName a name of property to search for
|
||||
* @param result an array of symbol of found property symbols
|
||||
* @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol.
|
||||
* The value of previousIterationSymbol is undefined when the function is first called.
|
||||
*/
|
||||
export function getPropertySymbolsFromBaseTypes<T>(symbol: Symbol, propertyName: string, checker: TypeChecker, cb: (symbol: Symbol) => T | undefined): T | undefined {
|
||||
const seen = createMap<true>();
|
||||
return recur(symbol);
|
||||
|
||||
function recur(symbol: Symbol): T | undefined {
|
||||
// Use `addToSeen` to ensure we don't infinitely recurse in this situation:
|
||||
// interface C extends C {
|
||||
// /*findRef*/propName: string;
|
||||
// }
|
||||
if (!(symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) || !addToSeen(seen, getSymbolId(symbol))) return;
|
||||
|
||||
return firstDefined(symbol.declarations, declaration => firstDefined(getAllSuperTypeNodes(declaration), typeReference => {
|
||||
const type = checker.getTypeAtLocation(typeReference);
|
||||
const propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);
|
||||
// Visit the typeReference as well to see if it directly or indirectly uses that property
|
||||
return type && propertySymbol && (firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type.symbol));
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
export function isMemberSymbolInBaseType(memberSymbol: Symbol, checker: TypeChecker): boolean {
|
||||
return getPropertySymbolsFromBaseTypes(memberSymbol.parent!, memberSymbol.name, checker, _ => true) || false;
|
||||
}
|
||||
|
||||
export class NodeSet {
|
||||
private map = createMap<Node>();
|
||||
|
||||
@@ -1473,7 +1505,7 @@ namespace ts {
|
||||
|
||||
export function typeToDisplayParts(typechecker: TypeChecker, type: Type, enclosingDeclaration?: Node, flags: TypeFormatFlags = TypeFormatFlags.None): SymbolDisplayPart[] {
|
||||
return mapToDisplayParts(writer => {
|
||||
typechecker.writeType(type, enclosingDeclaration, flags | TypeFormatFlags.MultilineObjectLiterals, writer);
|
||||
typechecker.writeType(type, enclosingDeclaration, flags | TypeFormatFlags.MultilineObjectLiterals | TypeFormatFlags.UseAliasDefinedOutsideCurrentScope, writer);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ for (; ;) {
|
||||
|
||||
//// [SystemModuleForStatementNoInitializer.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var i, limit;
|
||||
"use strict";
|
||||
var i, limit;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -17,8 +17,8 @@ module M {
|
||||
|
||||
//// [aliasesInSystemModule1.js]
|
||||
System.register(["foo"], function (exports_1, context_1) {
|
||||
var alias, cls, cls2, x, y, z, M;
|
||||
"use strict";
|
||||
var alias, cls, cls2, x, y, z, M;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [
|
||||
|
||||
@@ -16,8 +16,8 @@ module M {
|
||||
|
||||
//// [aliasesInSystemModule2.js]
|
||||
System.register(["foo"], function (exports_1, context_1) {
|
||||
var foo_1, cls, cls2, x, y, z, M;
|
||||
"use strict";
|
||||
var foo_1, cls, cls2, x, y, z, M;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [
|
||||
|
||||
@@ -11,8 +11,8 @@ export class Foo {
|
||||
|
||||
//// [a.js]
|
||||
System.register(["./b"], function (exports_1, context_1) {
|
||||
var b_1, x;
|
||||
"use strict";
|
||||
var b_1, x;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [
|
||||
|
||||
@@ -12,8 +12,8 @@ export class Foo {
|
||||
|
||||
//// [b.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var Foo;
|
||||
"use strict";
|
||||
var Foo;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
@@ -29,8 +29,8 @@ System.register([], function (exports_1, context_1) {
|
||||
});
|
||||
//// [a.js]
|
||||
System.register(["./b"], function (exports_1, context_1) {
|
||||
var b_1, x;
|
||||
"use strict";
|
||||
var b_1, x;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [
|
||||
|
||||
@@ -13,8 +13,8 @@ export var x = new Foo();
|
||||
|
||||
//// [a.js]
|
||||
System.register(["./b"], function (exports_1, context_1) {
|
||||
var b_1, x;
|
||||
"use strict";
|
||||
var b_1, x;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [
|
||||
|
||||
@@ -13,8 +13,8 @@ export var x = new Foo();
|
||||
|
||||
//// [a.js]
|
||||
System.register(["./b"], function (exports_1, context_1) {
|
||||
var b_1, x;
|
||||
"use strict";
|
||||
var b_1, x;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [
|
||||
|
||||
@@ -12,8 +12,8 @@ Foo.foo();
|
||||
|
||||
//// [a.js]
|
||||
System.register(["./b"], function (exports_1, context_1) {
|
||||
var b_1;
|
||||
"use strict";
|
||||
var b_1;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [
|
||||
|
||||
@@ -12,8 +12,8 @@ Foo.foo();
|
||||
|
||||
//// [a.js]
|
||||
System.register(["./b"], function (exports_1, context_1) {
|
||||
var b_1;
|
||||
"use strict";
|
||||
var b_1;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [
|
||||
|
||||
@@ -8,8 +8,8 @@ export default function() {}
|
||||
|
||||
//// [a.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var default_1;
|
||||
"use strict";
|
||||
var default_1;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== tests/cases/conformance/jsdoc/namespaced.js ===
|
||||
/**
|
||||
* @callback NS.Nested.Inner
|
||||
* @param {string} space - spaaaaaaaaace
|
||||
* @param {string} peace - peaaaaaaaaace
|
||||
* @param {Object} space - spaaaaaaaaace
|
||||
* @param {Object} peace - peaaaaaaaaace
|
||||
* @return {string | number}
|
||||
*/
|
||||
var x = 1;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== tests/cases/conformance/jsdoc/namespaced.js ===
|
||||
/**
|
||||
* @callback NS.Nested.Inner
|
||||
* @param {string} space - spaaaaaaaaace
|
||||
* @param {string} peace - peaaaaaaaaace
|
||||
* @param {Object} space - spaaaaaaaaace
|
||||
* @param {Object} peace - peaaaaaaaaace
|
||||
* @return {string | number}
|
||||
*/
|
||||
var x = 1;
|
||||
@@ -11,9 +11,9 @@ var x = 1;
|
||||
|
||||
/** @type {NS.Nested.Inner} */
|
||||
function f(space, peace) {
|
||||
>f : (space: string, peace: string) => string
|
||||
>space : string
|
||||
>peace : string
|
||||
>f : (space: any, peace: any) => string
|
||||
>space : any
|
||||
>peace : any
|
||||
|
||||
return '1'
|
||||
>'1' : "1"
|
||||
|
||||
@@ -144,8 +144,8 @@ for (const y = 0; y < 1;) {
|
||||
|
||||
//// [capturedLetConstInLoop4.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var v0, v00, v1, v2, v3, v4, v5, v6, v7, v8, v0_c, v00_c, v1_c, v2_c, v3_c, v4_c, v5_c, v6_c, v7_c, v8_c;
|
||||
"use strict";
|
||||
var v0, v00, v1, v2, v3, v4, v5, v6, v7, v8, v0_c, v00_c, v1_c, v2_c, v3_c, v4_c, v5_c, v6_c, v7_c, v8_c;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
//======let
|
||||
function exportedFoo() {
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
tests/cases/compiler/a.js(14,10): error TS2424: Class 'A' defines instance member function 'foo', but extended class 'B' defines it as instance member property.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
// @ts-check
|
||||
class A {
|
||||
constructor() {
|
||||
|
||||
}
|
||||
foo() {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
constructor() {
|
||||
super();
|
||||
this.foo = () => 3;
|
||||
~~~
|
||||
!!! error TS2424: Class 'A' defines instance member function 'foo', but extended class 'B' defines it as instance member property.
|
||||
}
|
||||
}
|
||||
|
||||
const i = new B();
|
||||
i.foo();
|
||||
@@ -9,6 +9,7 @@ export class Testing123 {
|
||||
|
||||
//// [a.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
@@ -16,7 +17,6 @@ System.register([], function (exports_1, context_1) {
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var Testing123_1, Testing123;
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -6,6 +6,7 @@ export class Testing123 { }
|
||||
|
||||
//// [a.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
@@ -13,7 +14,6 @@ System.register([], function (exports_1, context_1) {
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var Testing123_1, Testing123;
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -14,6 +14,7 @@ export default class {}
|
||||
|
||||
//// [a.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
@@ -21,7 +22,6 @@ System.register([], function (exports_1, context_1) {
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var decorator, Foo;
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
@@ -37,6 +37,7 @@ System.register([], function (exports_1, context_1) {
|
||||
});
|
||||
//// [b.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
@@ -44,7 +45,6 @@ System.register([], function (exports_1, context_1) {
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var decorator, default_1;
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -10,8 +10,8 @@ console.log(A + B + C + D + E + F)
|
||||
|
||||
//// [deduplicateImportsInSystem.js]
|
||||
System.register(["f1", "f2", "f3"], function (exports_1, context_1) {
|
||||
var f1_1, f2_1, f3_1, f2_2, f2_3, f1_2;
|
||||
"use strict";
|
||||
var f1_1, f2_1, f3_1, f2_2, f2_3, f1_2;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [
|
||||
|
||||
@@ -9,8 +9,8 @@ export default function foo() {}
|
||||
|
||||
//// [a.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var Foo;
|
||||
"use strict";
|
||||
var Foo;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -26,8 +26,8 @@ export { nonexportedFoo };
|
||||
export { exportedFoo as foo, nonexportedFoo as nfoo };
|
||||
|
||||
//// [destructuringAssignmentWithExportedName.js]
|
||||
var _a, _b, _c, _d, _e;
|
||||
"use strict";
|
||||
var _a, _b, _c, _d, _e;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.foo = exports.exportedFoo;
|
||||
let nonexportedFoo;
|
||||
|
||||
@@ -7,8 +7,8 @@ export let { toString } = 1;
|
||||
|
||||
//// [destructuringInVariableDeclarations7.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var toString;
|
||||
"use strict";
|
||||
var toString;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -8,8 +8,8 @@ export {};
|
||||
|
||||
//// [destructuringInVariableDeclarations8.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var toString;
|
||||
"use strict";
|
||||
var toString;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -9,8 +9,8 @@ export function bar() {
|
||||
|
||||
//// [dottedNamesInSystem.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var A;
|
||||
"use strict";
|
||||
var A;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
function bar() {
|
||||
return A.B.C.foo();
|
||||
|
||||
@@ -15,8 +15,8 @@ export default class A
|
||||
|
||||
//// [es5-system.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var A;
|
||||
"use strict";
|
||||
var A;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -3,8 +3,8 @@ export var __esModule = 1;
|
||||
|
||||
//// [es5-system2.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var __esModule;
|
||||
"use strict";
|
||||
var __esModule;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
//// [es6modulekindExportClassNameWithObject.ts]
|
||||
export class Object {}
|
||||
|
||||
|
||||
//// [es6modulekindExportClassNameWithObject.js]
|
||||
var Object = /** @class */ (function () {
|
||||
function Object() {
|
||||
}
|
||||
return Object;
|
||||
}());
|
||||
export { Object };
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/es6/es6modulekindExportClassNameWithObject.ts ===
|
||||
export class Object {}
|
||||
>Object : Symbol(Object, Decl(es6modulekindExportClassNameWithObject.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/es6/es6modulekindExportClassNameWithObject.ts ===
|
||||
export class Object {}
|
||||
>Object : Object
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
//// [exnextmodulekindExportClassNameWithObject.ts]
|
||||
export class Object {}
|
||||
|
||||
|
||||
//// [exnextmodulekindExportClassNameWithObject.js]
|
||||
var Object = /** @class */ (function () {
|
||||
function Object() {
|
||||
}
|
||||
return Object;
|
||||
}());
|
||||
export { Object };
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/esnext/exnextmodulekindExportClassNameWithObject.ts ===
|
||||
export class Object {}
|
||||
>Object : Symbol(Object, Decl(exnextmodulekindExportClassNameWithObject.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/esnext/exnextmodulekindExportClassNameWithObject.ts ===
|
||||
export class Object {}
|
||||
>Object : Object
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
//// [exportAmbientClassNameWithObject.ts]
|
||||
export declare class Object {}
|
||||
|
||||
|
||||
//// [exportAmbientClassNameWithObject.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportAmbientClassNameWithObject.ts ===
|
||||
export declare class Object {}
|
||||
>Object : Symbol(Object, Decl(exportAmbientClassNameWithObject.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportAmbientClassNameWithObject.ts ===
|
||||
export declare class Object {}
|
||||
>Object : Object
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
tests/cases/conformance/externalModules/exportClassNameWithObjectAMD.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 with module AMD.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportClassNameWithObjectAMD.ts (1 errors) ====
|
||||
export class Object {}
|
||||
~~~~~~
|
||||
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module AMD.
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//// [exportClassNameWithObjectAMD.ts]
|
||||
export class Object {}
|
||||
|
||||
|
||||
//// [exportClassNameWithObjectAMD.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Object = /** @class */ (function () {
|
||||
function Object() {
|
||||
}
|
||||
return Object;
|
||||
}());
|
||||
exports.Object = Object;
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportClassNameWithObjectAMD.ts ===
|
||||
export class Object {}
|
||||
>Object : Symbol(Object, Decl(exportClassNameWithObjectAMD.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportClassNameWithObjectAMD.ts ===
|
||||
export class Object {}
|
||||
>Object : Object
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
tests/cases/conformance/externalModules/exportClassNameWithObjectCommonJS.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportClassNameWithObjectCommonJS.ts (1 errors) ====
|
||||
export class Object {}
|
||||
~~~~~~
|
||||
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [exportClassNameWithObjectCommonJS.ts]
|
||||
export class Object {}
|
||||
|
||||
|
||||
//// [exportClassNameWithObjectCommonJS.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Object = /** @class */ (function () {
|
||||
function Object() {
|
||||
}
|
||||
return Object;
|
||||
}());
|
||||
exports.Object = Object;
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportClassNameWithObjectCommonJS.ts ===
|
||||
export class Object {}
|
||||
>Object : Symbol(Object, Decl(exportClassNameWithObjectCommonJS.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportClassNameWithObjectCommonJS.ts ===
|
||||
export class Object {}
|
||||
>Object : Object
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
tests/cases/conformance/externalModules/exportClassNameWithObjectSystem.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 with module System.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportClassNameWithObjectSystem.ts (1 errors) ====
|
||||
export class Object {}
|
||||
~~~~~~
|
||||
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module System.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
//// [exportClassNameWithObjectSystem.ts]
|
||||
export class Object {}
|
||||
|
||||
|
||||
//// [exportClassNameWithObjectSystem.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var Object;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
Object = /** @class */ (function () {
|
||||
function Object() {
|
||||
}
|
||||
return Object;
|
||||
}());
|
||||
exports_1("Object", Object);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportClassNameWithObjectSystem.ts ===
|
||||
export class Object {}
|
||||
>Object : Symbol(Object, Decl(exportClassNameWithObjectSystem.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportClassNameWithObjectSystem.ts ===
|
||||
export class Object {}
|
||||
>Object : Object
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
tests/cases/conformance/externalModules/exportClassNameWithObjectUMD.ts(1,14): error TS2725: Class name cannot be 'Object' when targeting ES5 with module UMD.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportClassNameWithObjectUMD.ts (1 errors) ====
|
||||
export class Object {}
|
||||
~~~~~~
|
||||
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module UMD.
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [exportClassNameWithObjectUMD.ts]
|
||||
export class Object {}
|
||||
|
||||
|
||||
//// [exportClassNameWithObjectUMD.js]
|
||||
(function (factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
var v = factory(require, exports);
|
||||
if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === "function" && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Object = /** @class */ (function () {
|
||||
function Object() {
|
||||
}
|
||||
return Object;
|
||||
}());
|
||||
exports.Object = Object;
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportClassNameWithObjectUMD.ts ===
|
||||
export class Object {}
|
||||
>Object : Symbol(Object, Decl(exportClassNameWithObjectUMD.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportClassNameWithObjectUMD.ts ===
|
||||
export class Object {}
|
||||
>Object : Object
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
tests/cases/conformance/externalModules/exportDefaultClassNameWithObject.ts(1,22): error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportDefaultClassNameWithObject.ts (1 errors) ====
|
||||
export default class Object {}
|
||||
~~~~~~
|
||||
!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS.
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [exportDefaultClassNameWithObject.ts]
|
||||
export default class Object {}
|
||||
|
||||
|
||||
//// [exportDefaultClassNameWithObject.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Object = /** @class */ (function () {
|
||||
function Object() {
|
||||
}
|
||||
return Object;
|
||||
}());
|
||||
exports.default = Object;
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportDefaultClassNameWithObject.ts ===
|
||||
export default class Object {}
|
||||
>Object : Symbol(Object, Decl(exportDefaultClassNameWithObject.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/externalModules/exportDefaultClassNameWithObject.ts ===
|
||||
export default class Object {}
|
||||
>Object : Object
|
||||
|
||||
@@ -35,8 +35,8 @@ export let h1: D = new D;
|
||||
|
||||
//// [exportNonInitializedVariablesSystem.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var a, b, c, d, A, e, f, B, C, a1, b1, c1, d1, D, e1, f1, g1, h1;
|
||||
"use strict";
|
||||
var a, b, c, d, A, e, f, B, C, a1, b1, c1, d1, D, e1, f1, g1, h1;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -13,8 +13,8 @@ var x = 1;
|
||||
|
||||
//// [file0.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var v;
|
||||
"use strict";
|
||||
var v;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
@@ -35,8 +35,8 @@ System.register([], function (exports_1, context_1) {
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register(["file0"], function (exports_1, context_1) {
|
||||
var x;
|
||||
"use strict";
|
||||
var x;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
function exportStar_1(m) {
|
||||
var exports = {};
|
||||
|
||||
@@ -19,8 +19,8 @@ System.register([], function (exports_1, context_1) {
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var x;
|
||||
"use strict";
|
||||
var x;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -19,8 +19,8 @@ System.register([], function (exports_1, context_1) {
|
||||
});
|
||||
//// [file2.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var x;
|
||||
"use strict";
|
||||
var x;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -30,6 +30,7 @@ export const l = async () => {
|
||||
|
||||
//// [test.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@@ -66,7 +67,6 @@ System.register([], function (exports_1, context_1) {
|
||||
}
|
||||
};
|
||||
var _this, cl1, obj, cl2, l;
|
||||
"use strict";
|
||||
_this = this;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
function fn() {
|
||||
|
||||
@@ -30,6 +30,7 @@ export const l = async () => {
|
||||
|
||||
//// [test.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@@ -66,7 +67,6 @@ System.register([], function (exports_1, context_1) {
|
||||
}
|
||||
};
|
||||
var _this, cl1, obj, cl2, l;
|
||||
"use strict";
|
||||
_this = this;
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
function fn() {
|
||||
|
||||
@@ -30,6 +30,7 @@ export const l = async () => {
|
||||
|
||||
//// [test.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
@@ -39,7 +40,6 @@ System.register([], function (exports_1, context_1) {
|
||||
});
|
||||
};
|
||||
var cl1, obj, cl2, l;
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
function fn() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user